[racket] Making a section optional in Scribble
That's about right but you want your conditional to produce some element.
In HtDP/2e, I use things like this all the time:
@(if draft? @bold{Draft Release} @bold{Stable Release})
where draft? is
@(define draft? (or (getenv "DRAFT") (is-draft?)))
that is, the flag is determined by either the environment or a command-line flag that is-draft? checks.
On Dec 16, 2014, at 6:53 PM, Daniel Prager wrote:
> Is there an easy way to include / exclude a section based on a flag?
>
> E.g. In the following example, I want to include section two for some folk, but not for others.
>
> #lang scribble/base
>
> @section{Section one}
>
> Section one is for everyone.
>
> @(when some-condition
>
> @section{Section two}
>
> "Section two is for some, but not all.")
>
>
> I've tried splitting section two into a second file and conditionally including it, but that caused level confusion.
>
>
> Thanks
>
> Dan
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141216/ee273882/attachment-0001.html>