Re: [racket-users] Unwelcome surprises using Scribble on a 90,000-word novel
On Fri, Aug 2, 2019 at 7:25 AM Hendrik Boom wrote: > > So I see two ways forward on the snipped include front: > > (1) Write a preprocessor along the lines of the C presprocessor, but a > lot simpler, that handles the include-section[]s by actually copying > them into the preprocessed copy of everything. > > or > > (3) Invent a completely new include mechanism. One that > explicitly calls the scribble reader on the included file and then > returns a resulting list of items as its contribution to the main text. > Some subtlety would be required here. Sorry for both being late to this discussion for possibly bringing up something that you may already have attempted, but did you try wrapping your "author-only" sections and defining an identifier for it? It might be a bit of a compromise of the two items you've referenced here, as it does need some extra code, but at least you don't need an external tool and it's a very modest amount of additional engineering. I had in mind something like: On Thu, Aug 1, 2019 at 7:25 AM Hendrik Boom wrote: > > (1) Some of the @ commands I use are intended to cause conditional > inclusion of their contents, dependong on a command-line arameter (which > haven't yet implemented in scribble. This is so I can keep my athor's > notes about the text in the text itself, read them while looking at > drafts, but have them removed for the final reader's copy. > > I've tested this by defining one of these operations (@snip) to delete > all its contents all of the time, and that works. (Command line > dependence will come later). > > But it is not possible to snip out entire sections. In particular, >@snip{ > @include-section{"author-only-section.scrbl"} >} > fails, complaining that there's a nested require. > > Is there some way around this? > "Wrap" the "author-only-section.scrbl" material in a little bit of packaging: #lang scribble/base @(provide author-only-section) @(define author-only-section @section{ @; Or a different structure/block as appropriate This is the content of the author-only-section. }) -- Then in the file where it is conditionally included: #lang scribble/base Pre-snip text. @(require "author-only-section.scrbl") @snip{@author-only-section} Post-snip text. ------ Of course, you can use a macro, as was alluded to above, to clean up the `require` boilerplate. Does that do something close enough to what you want without adding too much bulk? Benjamin Yeung -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAL%2BBSUJvBUpoatd7kQTsBsq_9xwakY8J8WaPo20Z8BtXrkjPpw%40mail.gmail.com.
Re: [racket-users] Unwelcome surprises using Scribble on a 90,000-word novel
On Fri, Aug 2, 2019 at 12:22 PM Hendrik Boom wrote: > > On Fri, Aug 02, 2019 at 10:46:26AM -0400, Benjamin Yeung wrote: > > > > On Thu, Aug 1, 2019 at 7:25 AM Hendrik Boom wrote: > > > > > > (1) Some of the @ commands I use are intended to cause conditional > > > inclusion of their contents, dependong on a command-line arameter (which > > > haven't yet implemented in scribble. This is so I can keep my athor's > > > notes about the text in the text itself, read them while looking at > > > drafts, but have them removed for the final reader's copy. > > > > > > I've tested this by defining one of these operations (@snip) to delete > > > all its contents all of the time, and that works. (Command line > > > dependence will come later). > > > > > > But it is not possible to snip out entire sections. In particular, > > >@snip{ > > > @include-section{"author-only-section.scrbl"} > > >} > > > fails, complaining that there's a nested require. > > > > > > Is there some way around this? > > > > > > > "Wrap" the "author-only-section.scrbl" material in a little bit of > > packaging: > > > > #lang scribble/base > > @(provide author-only-section) > > > > @(define author-only-section > > @section{ @; Or a different structure/block as appropriate > > This is the content of the author-only-section. > > }) > > Would this mean that the author-only-section could not itself have > other @include-sections within it, being nested within a define? A > minor flaw in my case, because I don't actually do that. And I could > use the same mechanism if I needed to. Yes, that's one of the drawbacks of this way of addressing your issue. Another is that if you change this from a section to a subsection (or otherwise change the depth), you need to be careful about modifying the optional file accordingly. I hope this accomplishes what you need! Benjamin Yeung -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAL%2BBSUL6iQ%3D0SeSTgUNqMYfG_fb1KZA0eDJSWSdXrFbjqfur-w%40mail.gmail.com.
Re: [racket-users] Is there an expanded form of the Racket2 purpose declaration?
On Wed, Aug 28, 2019 at 12:28 PM Jay McCarthy wrote: > > I'll add that I see S-expressions as obviously limited and it would be > nice to make a more powerful syntactic extension system that does not > say, "You can have anything you want, provided it is a parenthesis." > > So for me, I don't see the syntax mission as having anything to do > with students or getting people to like me, I see it as a way to go > beyond the limitations of S-expressions and do something more powerful > and interesting. I think people will like us more after in as much as > I think people like awesome things, and I want to make something > awesome. I think this point tends to get lost in all the existing material. It's already in the threads listed in the relevant posts section, but if people aren't "primed" to look for this particular point in there, it's easy to miss. That's one of the takeaways I get when I hear questions about the Racket2 purpose/goals/etc. Perhaps it's coming as part of the leadership team's meeting, but I think it would help reframe the syntax experiment if this was put forward more explicitly. Benjamin Yeung -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAL%2BBSUKzFD%2BVFRvYqmUjVKYbWZxKp3NJwcPQahbVuhW1ZH1m2w%40mail.gmail.com.