X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdocument-translation.scm;h=821eea401024a48282f162752df7f48861cb6021;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=9b4d7a23f6e252cb611cba3d34511b9c3f982b48;hpb=9f3572d98bb948c9689cd1f75401a029451fa001;p=lilypond.git diff --git a/scm/document-translation.scm b/scm/document-translation.scm index 9b4d7a23f6..821eea4010 100644 --- a/scm/document-translation.scm +++ b/scm/document-translation.scm @@ -1,8 +1,8 @@ ;;;; document-translation.scm -- Functions for engraver documentation ;;;; ;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 2000--2006 Han-Wen Nienhuys +;;;; +;;;; (c) 2000--2008 Han-Wen Nienhuys ;;;; Jan Nieuwenhuizen (define (engraver-makes-grob? name-symbol grav) @@ -21,7 +21,7 @@ (define (engraver-doc-string engraver in-which-contexts) (let* ((propsr (cdr (assoc 'properties-read (ly:translator-description engraver)))) (propsw (cdr (assoc 'properties-written (ly:translator-description engraver)))) - (accepted (cdr (assoc 'events-accepted (ly:translator-description engraver)))) + (accepted (cdr (assoc 'events-accepted (ly:translator-description engraver)))) (name-sym (ly:translator-name engraver)) (name-str (symbol->string name-sym)) (desc (cdr (assoc 'description (ly:translator-description engraver)))) @@ -45,20 +45,22 @@ (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)" + "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 - "This engraver creates the following layout objects: \n " - (human-listify (map ref-ify (uniq-list (sort grobs stringstring contexts) + stringstring contexts) stringengraver-table name #f)) (define (document-engraver-by-name name) "NAME is a symbol." - + (let* ((eg (find-engraver-by-name name))) (cons (string-append "@code{" (ref-ify (symbol->string name)) "}") @@ -127,16 +136,18 @@ (string-append "@item Set " - (format "grob-property @code{~a} " (string-join (map symbol->string path) " ")) - (format " in @ref{~a} to @code{~a}. " context-sym (scm->texi value)) + (format "grob-property @code{~a} " + (string-join (map symbol->string path) " ")) + (format "in @ref{~a} to ~a." + context-sym (scm->texi value)) "\n"))) ((equal? (object-property context-sym 'is-grob?) #t) "") ((equal? tag 'assign) - (format "@item Set translator property @code{~a} to @code{~a}" + (format "@item Set translator property @code{~a} to ~a.\n" context-sym (scm->texi (car args)))) ))) - + (define (context-doc context-desc) (let* ((name-sym (cdr (assoc 'context-name context-desc))) @@ -145,7 +156,7 @@ (desc-handle (assoc 'description context-desc)) (desc (if (and (pair? desc-handle) (string? (cdr desc-handle))) (cdr desc-handle) "(not documented)")) - + (accepts (cdr (assoc 'accepts context-desc))) (consists (cdr (assoc 'consists context-desc))) (props (cdr (assoc 'property-ops context-desc))) @@ -155,33 +166,47 @@ (make #:name name #:text - (string-append + (string-append desc (if (pair? aliases) - (string-append "\n\n This context also accepts commands for the following context(s):\n\n" - (human-listify aliases)) + (string-append + "\n\nThis context also accepts commands for the following context(s):\n\n" + (human-listify aliases) + ".") "") - "\n\nThis context creates the following layout objects: \n\n" - (human-listify (uniq-list (sort grob-refs stringstring accepts))))) - - "\n\nThis context is built from the following engravers: " - (description-list->texi - (map document-engraver-by-name consists)))))) + name + " can contain\n" + (human-listify (map ref-ify (map symbol->string accepts))) + ".")) + + (if (null? consists) + "" + (string-append + "\n\nThis context is built from the following engraver(s):" + (description-list->texi + (map document-engraver-by-name consists) + #t))))))) (define (engraver-grobs grav) (let* ((eg (if (symbol? grav) @@ -211,7 +236,7 @@ (make #:name "Contexts" - #:desc "Complete descriptions of all contexts" + #:desc "Complete descriptions of all contexts." #:children (map context-doc contexts)))) @@ -223,9 +248,9 @@ (define (all-engravers-doc) (make - #:name "Engravers" - #:desc "All separate engravers" - #:text "See @usermanref{Modifying context plug-ins}." + #:name "Engravers and Performers" + #:desc "All separate engravers and performers." + #:text "See @ruser{Modifying context plug-ins}." #:children (map engraver-doc all-engravers-list))) @@ -236,25 +261,25 @@ (map (lambda (x) (property->texi 'translation x '())) sortedsyms)) - (texi (description-list->texi propdescs))) + (texi (description-list->texi propdescs #f))) texi)) (define (translation-doc-node) (make #:name "Translation" - #:desc "From music to layout" + #:desc "From music to layout." #:children (list (all-contexts-doc) (all-engravers-doc) (make #:name "Tunable context properties" - #:desc "All tunable context properties" + #:desc "All tunable context properties." #:text (translation-properties-doc-string all-user-translation-properties)) (make #:name "Internal context properties" - #:desc "All internal context properties" + #:desc "All internal context properties." #:text (translation-properties-doc-string all-internal-translation-properties)))))