]> git.donarmstrong.com Git - lilypond.git/commitdiff
Markup command documentation: manually order categories
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Thu, 1 May 2008 10:45:27 +0000 (12:45 +0200)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Thu, 1 May 2008 10:45:27 +0000 (12:45 +0200)
When a new markup command category is added, update `ordered-categories'
in the markup-doc-node function, file scm/document-markup.scm
(otherwise the new category will be added at the end).

scm/document-markup.scm

index cffdf2afda238cac9da1d14a85db6ac3efa1c6d5..77ee9b97dce4fee30b81c818af65d53c310b1f56 100644 (file)
     #:name "Text markup commands"
     #:desc ""
     #:text "The following commands can all be used inside @code{\\markup @{ @}}."
-    #:children (let ((categories (sort (hash-fold (lambda (category function+properties categories)
-                                                    (cons category categories))
-                                                  (list)
-                                                  markup-functions-by-category)
-                                       (lambda (c1 c2)
-                                         (string<? (symbol->string c1)
-                                                   (symbol->string c2))))))
+    #:children (let* (;; when a new category is defined, update `ordered-categories'
+                      (ordered-categories '(font align graphic music fret-diagram other))
+                      (raw-categories (hash-fold (lambda (category functions categories)
+                                                   (cons category categories))
+                                                 (list)
+                                                 markup-functions-by-category))
+                      (categories (append ordered-categories
+                                          (filter (lambda (cat)
+                                                    (not (memq cat ordered-categories)))
+                                                  raw-categories))))
                  (map markup-category-doc-node categories))))
 
 (define (markup-list-doc-node)