From 098652444872263b7dd370d4f5b3022f79cd11a1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 29 Jan 2008 18:16:56 +0100 Subject: doc: Add section about "documents in Scheme programs". * doc/user/Makefile.am (EXTRA_DIST): Add `src/scheme.scm'. * doc/user/syntax.skb (Documents in Scheme Programs): New. --- doc/user/src/scheme.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/user/src/scheme.scm (limited to 'doc/user/src') diff --git a/doc/user/src/scheme.scm b/doc/user/src/scheme.scm new file mode 100644 index 0000000..0bb87e5 --- /dev/null +++ b/doc/user/src/scheme.scm @@ -0,0 +1,22 @@ +(use-modules (skribilo engine) ;; provides `find-engine' + (skribilo evaluator) ;; provides `evaluate-document' + (skribilo package base) ;; provides `chapter', etc. + (srfi srfi-1)) + +(let (;; Select an engine, i.e., an output format. + (e (find-engine 'html)) + + ;; Create a document. + (d (document #:title "Some Title" + (chapter #:title "The Chapter" + (p "The paragraph... " + "Text consists of " + "a list of strings.") + (apply itemize + (map number->string + (iota 10))))))) + + ;; "Evaluate" the document to an HTML file. + (with-output-to-file "foo.html" + (lambda () + (evaluate-document d e)))) -- cgit v1.2.3