summaryrefslogtreecommitdiff
path: root/doc/user/src/scheme.scm
blob: 0bb87e58ce909c410fd481ef9f46dd6ce7063d57 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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))))