summaryrefslogtreecommitdiff
path: root/doc/user/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/src')
-rw-r--r--doc/user/src/scheme.scm22
1 files changed, 22 insertions, 0 deletions
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))))