diff options
author | Ludovic Court`es | 2006-01-23 10:32:29 +0000 |
---|---|---|
committer | Ludovic Court`es | 2006-01-23 10:32:29 +0000 |
commit | 77f1210c86000ca8f2aa40cb148820d3e0eb3ca8 (patch) | |
tree | f6c367d0169a3293ae966f6447980d2d801525b3 /src/guile/skribilo.scm | |
parent | eefcf2eac6f4df4f0576ffbbccb280df17d463e4 (diff) | |
download | skribilo-77f1210c86000ca8f2aa40cb148820d3e0eb3ca8.tar.gz skribilo-77f1210c86000ca8f2aa40cb148820d3e0eb3ca8.tar.lz skribilo-77f1210c86000ca8f2aa40cb148820d3e0eb3ca8.zip |
Preliminary support for multiple reader front-ends.
* src/guile/skribilo.scm: Use `(skribilo reader)'.
(skribilo-options): Added `--reader'.
(skribilo): Read `--reader', parameterize `*document-reader*'.
* src/guile/skribilo/evaluator.scm (evaluate-document-from-port): Have
READER default to `*document-reader*'.
(include-document): Likewise.
* src/guile/skribilo/reader.scm: Load SRFIs 34, 35, and 39, as well as
`(skribilo condition)'. Export `*document-reader*'.
(&reader-search-error): New.
(lookup-reader): Raise a `&reader-search-error' condition if NAME is
not found.
(*document-reader*): New.
git-archimport-id: lcourtes@laas.fr--2004-libre/skribilo--devel--1.2--patch-32
Diffstat (limited to 'src/guile/skribilo.scm')
-rw-r--r-- | src/guile/skribilo.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/guile/skribilo.scm b/src/guile/skribilo.scm index 43885ee..285a92d 100644 --- a/src/guile/skribilo.scm +++ b/src/guile/skribilo.scm @@ -38,6 +38,7 @@ exec ${GUILE-guile} --debug -l $0 -c "(apply $main (cdr (command-line)))" "$@" (define-module (skribilo) :autoload (skribilo module) (make-run-time-module) :autoload (skribilo engine) (*current-engine*) + :autoload (skribilo reader) (*document-reader*) :use-module (skribilo utils syntax)) (use-modules (skribilo evaluator) @@ -80,6 +81,8 @@ specifications." `(define ,binding (quote ,(raw-options->getopt-long options)))) (define-options skribilo-options + (("reader" :alternate "R" :arg reader + (nothing))) (("target" :alternate "t" :arg target :help "sets the output format to <target>") (set! engine (string->symbol target))) @@ -194,6 +197,8 @@ specifications." Processes a Skribilo/Skribe source file and produces its output. + --reader=READER Use READER to parse the input file (by default, + the `skribe' reader is used) --target=ENGINE Use ENGINE as the underlying engine --help Give this help list @@ -381,6 +386,8 @@ Processes a Skribilo/Skribe source file and produces its output. (define-public (skribilo . args) (let* ((options (getopt-long (cons "skribilo" args) skribilo-options)) + (reader-name (string->symbol + (option-ref options 'reader "skribe"))) (engine (string->symbol (option-ref options 'target "html"))) (output-file (option-ref options 'output #f)) @@ -412,7 +419,8 @@ Processes a Skribilo/Skribe source file and produces its output. (lambda (file) (format #t "~~ loading `~a'...~%" file)))) - (parameterize ((*current-engine* engine) + (parameterize ((*document-reader* (make-reader reader-name)) + (*current-engine* engine) (*document-path* (cons load-path (*document-path*))) (*bib-path* (cons bib-path (*bib-path*))) (*source-path* (cons source-path |