add command-line options to control Scribble rendering #13

Closed
opened 10 years ago by mbutterick · 1 comments
mbutterick commented 10 years ago (Migrated from github.com)

As suggested by @mfelleisen:

Here is the relevant fragment from my own script that I have used for years to render HtDP/2e. I think you want to figure out how to invoke render here and what to give it as options:

;; String String Boolean String[URL] { [Class -> Class] } -> Void
;; the render-mixin implements render<%>
(define (scribble-it stem destination draft? redirect? (renderer render-mixin))
(define stem.scrbl (string-append stem ".scrbl"))
(define stem.html (string-append stem ".html"))
((dynamic-require "shared.ss" 'is-draft?) draft?)
(define stem.doc (dynamic-require stem.scrbl 'doc))
(render (list stem.doc) (list stem)
#:render-mixin renderer
#:dest-dir destination
#:xrefs (list (load-collections-xref))
#:quiet? #false
#:redirect-main redirect?)
;; ---
(parameterize ([current-directory destination])
(cleanup)
(send-url/file (if (file-exists? stem.html) stem.html (build-path stem "index.html")))))

Ultimately you want a specification language that matches your Pollen language design and whatever people specify should end up in this call.

BTW, instead of a .pollenrc file you probably want to run the server with a command-line flag where it absorbs the call.

As suggested by @mfelleisen: > Here is the relevant fragment from my own script that I have used for years to render HtDP/2e. I think you want to figure out how to invoke render here and what to give it as options: > > ;; String String Boolean String[URL] { [Class -> Class] } -> Void > ;; the render-mixin implements render<%> > (define (scribble-it stem destination draft? redirect? (renderer render-mixin)) > (define stem.scrbl (string-append stem ".scrbl")) > (define stem.html (string-append stem ".html")) > ((dynamic-require "shared.ss" 'is-draft?) draft?) > (define stem.doc (dynamic-require stem.scrbl 'doc)) > (render (list stem.doc) (list stem) > #:render-mixin renderer > #:dest-dir destination > #:xrefs (list (load-collections-xref)) > #:quiet? #false > #:redirect-main redirect?) > ;; --- > (parameterize ([current-directory destination]) > (cleanup) > (send-url/file (if (file-exists? stem.html) stem.html (build-path stem "index.html"))))) > > Ultimately you want a specification language that matches your Pollen language design and whatever people specify should end up in this call. > > BTW, instead of a .pollenrc file you probably want to run the server with a command-line flag where it absorbs the call.
mbutterick commented 10 years ago (Migrated from github.com)

Tabled for now; will consider later.

Tabled for now; will consider later.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#13
Loading…
There is no content yet.