#lang scribble/manual

@(require (only-in racket ~a))

@(define persons (list (hash
                        'name 'name1
                        'e-mail 'email1
                        'nickname 'nickname1)
                       (hash
                        'name 'name2
                        'e-mail 'email2
                        'nickname 'nickname2)
                       (hash
                        'name 'name3
                        'e-mail 'email3
                        'nickname 'nickname3)))

@(define (generate-section person)
   (list @section{Here's a section for @(~a (hash-ref person 'name))}
         @subsection{My information}
         @itemlist[
           @item{Email: @(~a (hash-ref person 'e-mail))}
           @item{Nickname: @(~a (hash-ref person 'nickname))}
         ]))

@(map generate-section persons)


generates this document:

[image: Screen Shot 2020-07-06 at 05.09.08.png]

On Mon, Jul 6, 2020 at 5:01 AM Oualmakran Yassine <[email protected]>
wrote:

>  Sure.
>
> I would like to create a document with a repetitive structure in scribble.
>
> Let say I have something like this:
> @section{First section}
> Some text ...
> @subsection{First subsection}
> @itemlist...
>
> @section{Second section}
> Some text ...
> @subsection{Second subsection}
> @itemlist...
>
> etc.
>
> I would like to know how is it possible to have this without writing
> multiple section, subsection, etc. every time (the purpose is more to
> understand how the language works than anything else).
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/4c4194c0-ff05-4dee-9b44-53b9e2e00e0eo%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/4c4194c0-ff05-4dee-9b44-53b9e2e00e0eo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegsbW5F_2vrAWp2GMr%3Dd55kxHiKYE7ADdoKPckWfZ5B1Jg%40mail.gmail.com.

Reply via email to