;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
-;;;; (c) 2000--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; (c) 2000--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
;;;; Jan Nieuwenhuizen <janneke@gnu.org>
(use-modules (oop goops)
(srfi srfi-1))
(define-class <texi-node> ()
+ (appendix #:init-value #f #:accessor appendix? #:init-keyword #:appendix)
(children #:init-value '() #:accessor node-children #:init-keyword #:children)
(text #:init-value "" #:accessor node-text #:init-keyword #:text)
(name #:init-value "" #:accessor node-name #:init-keyword #:name)
(node-name x)
(node-desc x)))
-(define* (dump-node node port level #:optional (appendix #f))
+(define* (dump-node node port level)
(display
(string-append
"\n@node "
- (node-name node)
- "\n\n"
- (if appendix
+ (if (= level 0) "Top" (node-name node))
+ "\n"
+ (if (appendix? node)
(texi-appendix-section-command level)
(texi-section-command level))
" "
(node-children node)))
""))
port)
- (map (lambda (x) (dump-node x port (+ 1 level) appendix))
+ (map (lambda (x) (dump-node x port (+ 1 level)))
(node-children node)))
(define (processing name)
(cdr (assoc level '(
;; Hmm, texinfo doesn't have ``part''
(0 . "@top")
- (1 . "@unnumbered")
- (2 . "@unnumberedsec")
- (3 . "@unnumberedsubsec")
+ (1 . "@chapter")
+ (2 . "@section")
+ (3 . "@subsection")
(4 . "@unnumberedsubsubsec")
(5 . "@unnumberedsubsubsec")))))
name)
(define (ref-ify x)
- "Add ref to X"
+ "Return @ref{X}. If mapping ref-ify to a list that needs to be sorted,
+ sort the list first."
(string-append "@ref{" x "}"))
(define (human-listify lst)