X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdocument-translation.scm;h=921d8192b9b9d46f1515d2cbdc351fdec5508cd4;hb=87a6cd2bb1bb582cca6769bf982f33b4a8fcb7f9;hp=192f39f69a49c6d4e684ed2f2ce985b977f9421c;hpb=d983c03ae234308c7b284f42e00aff40fd93e14c;p=lilypond.git diff --git a/scm/document-translation.scm b/scm/document-translation.scm index 192f39f69a..921d8192b9 100644 --- a/scm/document-translation.scm +++ b/scm/document-translation.scm @@ -2,7 +2,7 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 2000--2004 Han-Wen Nienhuys +;;;; (c) 2000--2007 Han-Wen Nienhuys ;;;; Jan Nieuwenhuizen (define (engraver-makes-grob? name-symbol grav) @@ -45,7 +45,7 @@ (string-append "Properties (read)" (description-list->texi - (map (lambda (x) (property->texi 'translation x '())) propsr))) + (map (lambda (x) (property->texi 'translation x '())) propsr))) "") (if (null? propsw) @@ -53,12 +53,12 @@ (string-append "Properties (write)" (description-list->texi - (map (lambda (x) (property->texi 'translation x '())) propsw)))) + (map (lambda (x) (property->texi 'translation x '())) propsw)))) (if (null? grobs) "" (string-append - "This engraver creates the following layout objects: \n " - (human-listify (map ref-ify (uniq-list (sort grobs stringstring name)) "}") (engraver-doc-string eg #f)))) (define (document-property-operation op) (let ((tag (car op)) - (body (cdr op)) - (sym (cadr op))) + (context-sym (cadr op)) + (args (cddr op)) + ) (cond ((equal? tag 'push) + (let* + ((value (car args)) + (path (cdr args))) + (string-append - "@item " - (if (null? (cddr body)) - "Revert " - "Set ") - "grob-property @code{" - (symbol->string (cadr body)) - "} in @ref{" (symbol->string sym) - "}" - (if (not (null? (cddr body))) - (string-append " to @code{" (scm->texi (cadr (cdr body))) "}" )) - "\n")) - ((equal? (object-property sym 'is-grob?) #t) "") - ((equal? (car op) 'assign) - (string-append - "@item Set translator property @code{" - (symbol->string (car body)) - "} to @code{" - (scm->texi (cadr body)) - "}\n"))))) + "@item Set " + (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 ~a.\n" + context-sym + (scm->texi (car args)))) + ))) + (define (context-doc context-desc) (let* ((name-sym (cdr (assoc 'context-name context-desc))) @@ -149,12 +149,7 @@ (cdr desc-handle) "(not documented)")) (accepts (cdr (assoc 'accepts context-desc))) - (group (assq-ref context-desc 'group-type)) - - (consists (append - (if group (list group) - '()) - (cdr (assoc 'consists context-desc)))) + (consists (cdr (assoc 'consists context-desc))) (props (cdr (assoc 'property-ops context-desc))) (grobs (context-grobs context-desc)) (grob-refs (map (lambda (x) (ref-ify x)) grobs))) @@ -165,30 +160,42 @@ (string-append desc (if (pair? aliases) - (string-append "\n\n This context is also known as: \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))))) + name + " can contain\n" + (human-listify (map ref-ify (map symbol->string accepts))) + ".")) - "\n\nThis context is built from the following engravers: " - (description-list->texi - (map document-engraver-by-name consists)))))) + (if (null? consists) + "" + (string-append + "\n\nThis context is built from the following engravers:" + (description-list->texi (map document-engraver-by-name consists)))))))) (define (engraver-grobs grav) (let* ((eg (if (symbol? grav) @@ -218,7 +225,7 @@ (make #:name "Contexts" - #:desc "Complete descriptions of all contexts" + #:desc "Complete descriptions of all contexts." #:children (map context-doc contexts)))) @@ -231,7 +238,7 @@ (define (all-engravers-doc) (make #:name "Engravers" - #:desc "All separate engravers" + #:desc "All separate engravers." #:text "See @usermanref{Modifying context plug-ins}." #:children (map engraver-doc all-engravers-list))) @@ -249,19 +256,19 @@ (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)))))