X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdocument-markup.scm;h=bbc8939e0281943478a32bfb2e7eed3fc1c8ba70;hb=HEAD;hp=35347ae15083c0fac3c47c416c05857f88d4b37b;hpb=d2762a4f1add2bb04d6fc34d3c7ae03eeb7d500f;p=lilypond.git diff --git a/scm/document-markup.scm b/scm/document-markup.scm index 35347ae150..bbc8939e02 100644 --- a/scm/document-markup.scm +++ b/scm/document-markup.scm @@ -18,7 +18,7 @@ (define (doc-markup-function-properties func) - (let ((properties (hashq-ref markup-functions-properties func)) + (let ((properties (markup-function-properties func)) (prop-strings (list))) (for-each (lambda (prop-spec) (set! prop-strings @@ -41,16 +41,17 @@ (or properties (list))) prop-strings)) -(define (doc-markup-function func) - (let* ((full-doc (procedure-documentation func)) +(define (doc-markup-function func-pair) + (let* ((f-name (symbol->string (car func-pair))) + (func (cdr func-pair)) + (full-doc (procedure-documentation func)) (match-args (and full-doc (string-match "^\\([^)]*\\)\n" full-doc))) (arg-names (if match-args (with-input-from-string (match:string match-args) read) (circular-list "arg"))) (doc-str (if match-args (match:suffix match-args) full-doc)) - (f-name (symbol->string (procedure-name func))) (c-name (regexp-substitute/global #f "-markup(-list)?$" f-name 'pre "" 'post)) - (sig (object-property func 'markup-signature)) + (sig (markup-command-signature func)) (sig-type-names (map type-name sig)) (signature-str (string-join @@ -73,19 +74,41 @@ (string-concatenate prop-strings) "@end itemize\n")))))) -(define (markup-functionstring (procedure-name a)) (symbol->string (procedure-name b)))) +(define (markup-namestring (car a)) (symbol->string (car b)))) + +(define all-markup-commands '()) +(define all-markup-list-commands '()) + +(for-each + (lambda (m) + (module-for-each (lambda (sym var) + (let ((val (variable-ref var))) + (cond ((markup-function? val) + (set! all-markup-commands + (acons sym val all-markup-commands))) + ((markup-list-function? val) + (set! all-markup-list-commands + (acons sym val all-markup-list-commands)))))) + (module-public-interface m))) + (cons (current-module) (map resolve-module '((lily) (scm accreg))))) + +(set! all-markup-commands (sort! all-markup-commands markup-namestring category)) (category-name (string-capitalize (regexp-substitute/global #f "-" category-string 'pre " " 'post))) - (markup-functions (hash-fold (lambda (markup-function dummy functions) - (cons markup-function functions)) - '() - (hashq-ref markup-functions-by-category - category)))) + (markup-functions (filter + (lambda (fun) + (let ((cats (markup-function-category (cdr fun)))) + (if (pair? cats) + (memq category cats) + (eq? category cats)))) + all-markup-commands))) + (make #:appendix #t #:name category-name @@ -93,8 +116,7 @@ #:text (string-append "@table @asis" (string-concatenate - (map doc-markup-function - (sort markup-functions markup-function