(if (pair? uprops)
(string-append
"\n\n@unnumberedsubsubsec User settable properties:\n"
- (description-list->texi user-propdocs))
+ (description-list->texi user-propdocs #t))
"")
(if (pair? iprops)
(string-append
"\n\n@unnumberedsubsubsec Internal properties:\n"
- (description-list->texi internal-propdocs))
+ (description-list->texi internal-propdocs #t))
""))))
(define iface->grob-table (make-vector 61 '()))
(description-list->texi
(map (lambda (y) (property->texi 'backend y alist))
- uprops))))
+ uprops)
+ #t)))
(define (grob-doc description)
"Given a property alist DESCRIPTION, make a documentation
(let* ((ps (sort (map symbol->string lst) string<?))
(descs (map (lambda (prop)
(property->texi 'backend (string->symbol prop) '())) ps))
- (texi (description-list->texi descs)))
+ (texi (description-list->texi descs #f)))
texi))
;;(dump-node (grob-doc (cdadr all-grob-descriptions)) (current-output-port) 0 )
;;
;; document-identifiers.scm -- implement documentation
;; of identifiers from .ly file.
-;;
+;;
;; source file of the GNU LilyPond music typesetter
-;;
+;;
;; (c) 2006 Han-Wen Nienhuys <hanwen@lilypond.org>
-;;
-
+;;
(use-modules (ice-9 format))
(music-func (cdr music-func-pair))
(func (ly:music-function-extract music-func))
(arg-names
- (map symbol->string
+ (map symbol->string
(cddr (cadr (procedure-source func)))))
(doc (procedure-documentation func))
(sign (object-property func 'music-function-signature))
(type-names (map type-name sign))
- ;; C&P
- (signature (zip arg-names arg-names type-names))
(signature-str
- (string-join
- (map (lambda (x) (format "@var{~a} (~a)"
- (car x)
- (cadr x)))
-
- (zip arg-names type-names)))))
-
+ (string-join
+ (map (lambda (x) (format "@var{~a} (~a)"
+ (car x)
+ (cadr x)))
+ (zip arg-names type-names)))))
(format
-
- "\n
-@item @code{~a} - ~a\n
+ "@item @code{~a}~a~a
@findex ~a
-
-~a\n\n"
-
- name-sym signature-str
+~a
+"
+ name-sym (if (equal? "" signature-str) "" " - ") signature-str
name-sym
(if doc doc "(undocumented; fixme)"))))
-
(define (document-object obj-pair)
(cond
- ((ly:music-function? (cdr obj-pair)) (document-music-function obj-pair))
+ ((ly:music-function? (cdr obj-pair))
+ (document-music-function obj-pair))
(else
#f)))
+
+(define (identifier<? a b)
+ (string<?
+ (symbol->string (car a))
+ (symbol->string (car b))))
+
+
(define-public (identifiers-doc-string)
(format
"@table @asis
~a
@end table
"
- (string-join
- (filter
- identity
- (map
- document-object
- (ly:module->alist (current-module)))))))
+ (string-join
+ (filter
+ identity
+ (map
+ document-object
+ (sort
+ (ly:module->alist (current-module))
+ identifier<?)))
+ "")))
(descs (map (lambda (prop)
(property->texi 'music (string->symbol prop)))
ps))
- (texi (description-list->texi descs)))
+ (texi (description-list->texi descs #f)))
texi)))
(define music-types->names (make-vector 61 '()))
(description-list->texi
(map
(lambda (x) (property->texi 'music x props))
- (map car props))))))
+ (map car props))
+ #t))))
(define (music-object-doc obj)
(make <texi-node>
(string-append
"Properties (read)"
(description-list->texi
- (map (lambda (x) (property->texi 'translation x '())) propsr)))
+ (map (lambda (x) (property->texi 'translation x '())) propsr)
+ #t))
"")
(if (null? propsw)
(string-append
"Properties (write)"
(description-list->texi
- (map (lambda (x) (property->texi 'translation x '())) propsw))))
+ (map (lambda (x) (property->texi 'translation x '())) propsw)
+ #t)))
(if (null? grobs)
""
(string-append
""
(string-append
"\n\nThis context is built from the following engravers:"
- (description-list->texi (map document-engraver-by-name consists))))))))
+ (description-list->texi
+ (map document-engraver-by-name consists)
+ #t)))))))
(define (engraver-grobs grav)
(let* ((eg (if (symbol? grav)
(map
(lambda (x) (property->texi 'translation x '()))
sortedsyms))
- (texi (description-list->texi propdescs)))
+ (texi (description-list->texi propdescs #f)))
texi))
(define (translation-doc-node)
(5 . "@unnumberedsubsubsec")))))
(define (one-item->texi label-desc-pair)
- "Document one (LABEL . DESC); return empty string if LABEL is empty string.
-"
+ "Document one (LABEL . DESC); return empty string if LABEL is empty string."
(if (eq? (car label-desc-pair) "")
""
(string-append "\n@item " (car label-desc-pair) "\n" (cdr label-desc-pair))))
-(define (description-list->texi items-alist)
- "Document ITEMS-ALIST in a table. entries contain (item-label
-. string-to-use)
-"
+(define (description-list->texi items-alist quote?)
+ "Document ITEMS-ALIST in a table; entries contain (item-label . string-to-use)."
(string-append
"\n"
- "@quotation\n"
+ (if quote? "@quotation\n" "")
"@table @asis\n"
(apply string-append (map one-item->texi items-alist))
"\n"
"@end table\n"
- "@end quotation\n"))
+ (if quote? "@end quotation\n" "")))
(define (texi-menu items-alist)
"Generate what is between @menu and @end menu."
"\n@ignore\n"
"\n@ifhtml\n"
(description-list->texi (map (lambda (x) (cons (ref-ify (car x)) (cdr x)))
- items-alist))
+ items-alist)
+ #t)
"\n@end ifhtml\n"
"\n@end ignore\n")))