> On Apr 22, 2016, at 5:36 PM, Hendrik Boom <[email protected]> wrote:
> 
> It seems scribble likes to put its output where the document source is,
> with a different file extension.
> 
> I like to separate my source code from generated files.
> 
> (1) How can I tell scribble to place the generated html into a
> different directory?  Is there a command line option for this?
> 
> (2) Are the various css files and the like always the same?  If not,
> I'd have to specify their names to prevent conflicts between
> independent documents that happen to be in the sme directory.

FWIW, In case you want racket code to accomplish this, this appears
to work for me:

;; given a source directory and a destination directory, render
;; every scribble file in the source directory (except the ones starting
;; with ._) into the destination directory
(define (zzz src-dir dest-dir)
  (parameterize ([current-directory src-dir])
    (define renderer (new (render-mixin render%) [dest-dir dest-dir]))
    (for ([source (in-list (directory-list))]
          #:when (regexp-match #rx".*\\.scrbl$" (path->string source))
          #:when (not (regexp-match #rx"^\\._" (path->string source))))
      (let* ([source-stem (cadr (regexp-match #rx"(.*)\\.scrbl" (path->string 
source)))]
             [tgt-file (string-append source-stem ".html")]
             [docs (list (dynamic-require (build-path src-dir source) 'doc))]
             [tgts (list (build-path dest-dir tgt-file))]
             [ht (send renderer traverse docs tgts)]
             [collect-info (send renderer collect docs tgts ht)]
             [resolve-info (send renderer resolve docs tgts collect-info)])
        (send renderer render docs tgts resolve-info)))))


-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: PGP signature

Reply via email to