Re: [racket-dev] conditional scribble documents
20 minutes ago, Danny Yoo wrote: > > I know I can always hack around Scribble limitations. (How is this different from running any other program that needs to work in several differen ways? ...) > Conditional generation is a common use case. In particular, the use > case I'm considering directly affects the Bootstrap curriculum work > I'm doing in the summer: we need to generate documentation for both > students and teachers, and we'd really like to use the same source > file. ... for example, why not set up files that set some parameter and then run the program. You said that you want a `++load my-module.rkt' -- why not change "my-module.rkt" -> "my-module.scrbl", and just render it? > As such, I'd really like a good way to set up parameterizations in a > way that's directly supported by the Scribble command line tool. > The scribble tool is hardcoded to set up certain parameterizations, > such as current-render-mixin, through its command line arguments. > I'd like that facility to be open to extension. Alternatively, propagating some user-defined command line flag to the scribble code is the same solution as using an environment variable. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] conditional scribble documents
On Wed, Apr 25, 2012 at 6:38 PM, Matthias Felleisen wrote: > > For HtDP/2e, I use plain old conditionals and variables. > I used to set an environment variable when I ran a shell > script. Then I converted everything to Racket and set > variables according to shell arguments: > > $ ./xhtml draft > > creates the draft version of HtDP/2e by setting a *draft > variable to #t and in other places I simply write > > @(if *draft "Draft" "Release") > > and such. -- Matthias I know I can always hack around Scribble limitations.I can always do a trick that LaTeX users know: to create a named file that acts like a flag and use the InputIfFileExists LaTeX macro. But I always feel very dirty when I do that: I feel like I'm unable to communicate intent to my tools when I take back-channels like that. Conditional generation is a common use case. In particular, the use case I'm considering directly affects the Bootstrap curriculum work I'm doing in the summer: we need to generate documentation for both students and teachers, and we'd really like to use the same source file. As such, I'd really like a good way to set up parameterizations in a way that's directly supported by the Scribble command line tool. The scribble tool is hardcoded to set up certain parameterizations, such as current-render-mixin, through its command line arguments. I'd like that facility to be open to extension. _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] conditional scribble documents
For HtDP/2e, I use plain old conditionals and variables. I used to set an environment variable when I ran a shell script. Then I converted everything to Racket and set variables according to shell arguments: $ ./xhtml draft creates the draft version of HtDP/2e by setting a *draft variable to #t and in other places I simply write @(if *draft "Draft" "Release") and such. -- Matthias On Apr 25, 2012, at 3:58 PM, Danny Yoo wrote: > I'm working on building a Scribble extension that lets me write > conditional bits of Scribble code. > > Some use cases: 1. writing a document that can be author-anonymized > 2. tutorial material, with solutions to be generated in the document > targetted for teachers. > > I do not want to hide or show content with styles: it's too easy to do > "View Source" on an HTML document. I really do want conditional > generation. > > > Unlike cond-element, the branch should not be tied to the output > format, but rather to some external parameterization. > > However, I don't see a clean way of introducing the parameterization > when Scribble is being executed. I could hack with the '++xref' flag > so that the module/function I name there will be a no-op in terms of > returning xrefs, but will as a side-effect set up the parameters I > need. But that makes me feel extremely dirty. > > I do want to be able to say something like: > > scribble ... ++load my-module.rkt ... > > where my-module.rkt will add the parameterizations I need to generate > conditional content, but of course there's no such thing as "++load" > yet. > > > > Suggestions? Thanks! > _ > Racket Developers list: > http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] conditional scribble documents
I'm working on building a Scribble extension that lets me write conditional bits of Scribble code. Some use cases: 1. writing a document that can be author-anonymized 2. tutorial material, with solutions to be generated in the document targetted for teachers. I do not want to hide or show content with styles: it's too easy to do "View Source" on an HTML document. I really do want conditional generation. Unlike cond-element, the branch should not be tied to the output format, but rather to some external parameterization. However, I don't see a clean way of introducing the parameterization when Scribble is being executed. I could hack with the '++xref' flag so that the module/function I name there will be a no-op in terms of returning xrefs, but will as a side-effect set up the parameters I need. But that makes me feel extremely dirty. I do want to be able to say something like: scribble ... ++load my-module.rkt ... where my-module.rkt will add the parameterizations I need to generate conditional content, but of course there's no such thing as "++load" yet. Suggestions? Thanks! _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Thanks for faster builds!
I recently completed a full build from source in 15-20 minutes; I think that's about *half* of what it used to take. Many thanks! John smime.p7s Description: S/MIME cryptographic signature _ Racket Developers list: http://lists.racket-lang.org/dev