~ubuntu-branches/ubuntu/precise/lilypond/precise

« back to all changes in this revision

Viewing changes to scm/document-markup.scm

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2006-12-19 10:18:12 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061219101812-7awtjkp0i393wxty
Tags: 2.8.7-3
scripts/midi2ly.py: When setting DATADIR, find Lilypond python files
in the @TOPLEVEL_VERSION@ directory, not 'current'.  Patch thanks to
Chris Lamb (chris@chris-lamb.co.uk).  (Closes: #400550)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
;;;;
3
3
;;;;  source file of the GNU LilyPond music typesetter
4
4
;;;; 
5
 
;;;; (c)  1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
5
;;;; (c) 1998--2006 Han-Wen Nienhuys <hanwen@cs.uu.nl>
6
6
;;;;                 Jan Nieuwenhuizen <janneke@gnu.org>
7
7
 
8
8
(define (doc-markup-function func)
9
 
  (let*
10
 
      (
11
 
       (doc-str  (procedure-documentation func) )
12
 
       (f-name (symbol->string (procedure-name  func)))
13
 
       (c-name (regexp-substitute/global #f "-markup$" f-name  'pre "" 'post))
14
 
       (sig (object-property func 'markup-signature))
15
 
       (arg-names
16
 
        (map symbol->string 
17
 
             (cddr (cadr (procedure-source func)))))
18
 
       
19
 
       (sig-type-names (map type-name sig))
20
 
       (signature (zip arg-names  sig-type-names))
21
 
       (signature-str
22
 
        (string-join
23
 
         (map (lambda (x) (string-append
24
 
                           "@var{" (car x) "} ("  (cadr x) ")" ))
25
 
              (zip arg-names  sig-type-names))
26
 
         " " )))
27
 
    
28
 
    
29
 
       
30
 
  (string-append
31
 
   "\n\n@item @code{\\" c-name "} " signature-str
32
 
   
33
 
   "\n@findex " f-name "\n"
34
 
   "\n@cindex " c-name "\n"
35
 
   
36
 
   (if (string? doc-str)
37
 
       doc-str
38
 
       "")
39
 
  )))
 
9
  (let* ((doc-str  (procedure-documentation func))
 
10
         (f-name (symbol->string (procedure-name  func)))
 
11
         (c-name (regexp-substitute/global #f "-markup$" f-name  'pre "" 'post))
 
12
         (sig (object-property func 'markup-signature))
 
13
         (arg-names
 
14
          (map symbol->string 
 
15
               (cddr (cadr (procedure-source func)))))
 
16
         
 
17
         (sig-type-names (map type-name sig))
 
18
         (signature (zip arg-names  sig-type-names))
 
19
         (signature-str
 
20
          (string-join
 
21
           (map (lambda (x) (string-append
 
22
                             "@var{" (car x) "} ("  (cadr x) ")" ))
 
23
                (zip arg-names  sig-type-names))
 
24
           " " )))
 
25
    
 
26
    (string-append
 
27
     "\n\n@item @code{\\" c-name "} " signature-str
 
28
     
 
29
     "\n@findex " f-name "\n"
 
30
     "\n@cindex @code{" c-name "}\n"
 
31
     
 
32
     (if (string? doc-str)
 
33
         doc-str
 
34
         ""))))
40
35
 
41
36
(define (markup-function<? a b)
42
37
  (string<? (symbol->string (procedure-name a)) (symbol->string (procedure-name b))))
43
38
 
44
39
(define (markup-doc-string)
45
40
  (string-append
46
 
         
47
 
         "@table @asis"
48
 
         (apply string-append
49
 
         
50
 
                (map doc-markup-function
51
 
                     (sort markup-function-list markup-function<?) ) )
52
 
         "\n@end table"
53
 
 
54
 
         ))
 
41
   
 
42
   "@table @asis"
 
43
   (apply string-append
 
44
          
 
45
          (map doc-markup-function
 
46
               (sort markup-function-list markup-function<?)))
 
47
   "\n@end table"))
55
48
 
56
49
(define (markup-doc-node)
57
50
  (make <texi-node>