RE: [racket-users] repeated code in interactions of scribble
Hi Ben Greenman Unsyntaxed elemtag and elemref work well in code:comment. I did this as follows: #lang scribble/manual @require[scribble/example] @(define my-eval (make-base-eval)) Beginning. @examples[#:eval my-eval (code:comment #,(elemtag "plus2" "")) (define (plus2 n) (+ 2 n)) (plus2 0) (plus2 1) ] Intermission. @examples[#:eval my-eval (code:comment #,(list "See " (elemref "plus2" "previous example") " for the definition of plus2.")) (define (plus4 n) (plus2 (plus2 n))) (plus4 0) ] Conclusion. Thanks again for your help. Jos Koot _ From: Jos Koot [mailto:jos.k...@gmail.com] Sent: domingo, 24 de septiembre de 2017 13:01 To: 'Ben Greenman' Cc: 'Racket Users'; 'Jos Koot' Subject: RE: [racket-users] repeated code in interactions of scribble Thanks very much. A nice and clear answer. May be I can insert tagged elements and elemrefs in code:comment escaping with #, in order to provide links to definitions in previous examples. I'll try that later. Thanks again, Jos _ From: Ben Greenman [mailto:benjaminlgreen...@gmail.com] Sent: domingo, 24 de septiembre de 2017 6:45 To: Jos Koot Cc: Racket Users Subject: Re: [racket-users] repeated code in interactions of scribble You can re-use helper functions by running the different example blocks with the same evaluator (example below). I don't know how to hyperlink one interaction to another. - - - #lang scribble/manual @require[scribble/example] @(define my-eval (make-base-eval)) Beginning. @examples[#:eval my-eval (define (plus2 n) (+ 2 n)) (plus2 0) (plus2 1) ] Intermission. @examples[#:eval my-eval (define (plus4 n) (plus2 (plus2 n))) (plus4 0) ] Conclusion. -- 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 racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
RE: [racket-users] repeated code in interactions of scribble
Thanks very much. A nice and clear answer. May be I can insert tagged elements and elemrefs in code:comment escaping with #, in order to provide links to definitions in previous examples. I'll try that later. Thanks again, Jos _ From: Ben Greenman [mailto:benjaminlgreen...@gmail.com] Sent: domingo, 24 de septiembre de 2017 6:45 To: Jos Koot Cc: Racket Users Subject: Re: [racket-users] repeated code in interactions of scribble You can re-use helper functions by running the different example blocks with the same evaluator (example below). I don't know how to hyperlink one interaction to another. - - - #lang scribble/manual @require[scribble/example] @(define my-eval (make-base-eval)) Beginning. @examples[#:eval my-eval (define (plus2 n) (+ 2 n)) (plus2 0) (plus2 1) ] Intermission. @examples[#:eval my-eval (define (plus4 n) (plus2 (plus2 n))) (plus4 0) ] Conclusion. -- 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 racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] repeated code in interactions of scribble
You can re-use helper functions by running the different example blocks with the same evaluator (example below). I don't know how to hyperlink one interaction to another. - - - #lang scribble/manual @require[scribble/example] @(define my-eval (make-base-eval)) Beginning. @examples[#:eval my-eval (define (plus2 n) (+ 2 n)) (plus2 0) (plus2 1) ] Intermission. @examples[#:eval my-eval (define (plus4 n) (plus2 (plus2 n))) (plus4 0) ] Conclusion. -- 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 racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] repeated code in interactions of scribble
Hi, What would be the easiest way to avoid duplication of code in interactions within a scribble/manual document? I often place examples in such a document. In some of them I need the same auxiliary procedures. How to avoid duplicating them? The most nice solution would be the appearance of a hyperlink within an interaction to a procedure in a previous interaction. In the docs of Racket I see examples that do refer to procedures defined in previous examples. Hence it must be possible. I have looked around how it is done in the Racket docs, but it has not become clear to me how to acheive my goal. Thanks, Jos. -- 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 racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.