denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Denemo-devel] Documentation on variables and procedures callable from s


From: Richard Shann
Subject: [Denemo-devel] Documentation on variables and procedures callable from scheme.
Date: Tue, 15 Dec 2009 17:37:52 +0000

I have updated the manual with a table of all the Denemo variables and
commands known to scheme.

For the record, below is the scheme used to generate the table of
commands/variables (it puts the xml table into a file called "mydocs").

;;;;;;;;;;;;;;;;;
;;;;;;;;;; create xml documentation for a command
;;;;;;;;;;;;;XmlDocumentCommand
(define (XmlDocumentCommand name port)
  (let ((help (d-GetHelp name)) (label (d-GetLabel name)) (menu
(d-GetMenuPath name)))
    (if (boolean? help)
        (begin
          (set! help (string-append "Help-d-" name))      
          (let ((sym (with-input-from-string help read)))
            (if (defined? sym)
                (set! help (eval sym (current-module)))
                (set! help "No help")
                ))))
    (if (not (string? label))
        (set! label "--"))
    (if (not (string? menu))
        (set! menu "--"))
    (format port "<entry>~A</entry>~%<entry>~A</entry>~
%<entry>~A</entry>~%<entry>~A</entry>~%" (html-escape name) (html-escape
help) (html-escape label) (html-escape menu))))
;;;;;;;;;;;;;;;


;;;;;;;;;;;; xmlDocumenting all the commands
(define docport (open-output-file "mydocs"))
(format docport "<informaltable><tgroup cols=\"4
\"><thead><row><entry>Command Name</entry>
<entry>Help</entry>
<entry>Label</entry>
<entry>Menu Path</entry>~%</row></thead><tbody>")
(module-for-each (lambda (name var)
                    (let ((mystring ""))
                      (set! mystring (format #f "~a" name))
                      (if (> (string-length mystring) 2)
                          (begin
                            (if (string=? "d-" (substring mystring 0 2))        
                                (set! mystring (substring mystring 2))
                                (if (> (string-length mystring) 7)
                                    (if (string=? "Help-d-" (substring mystring 
0 7));; a tooltip so
ignore
                                        (set! mystring #f))))))
                      (if (not (boolean? mystring))
                          (begin
                            (format docport "<row>~%")
                      (XmlDocumentCommand mystring docport)
                      (format docport "</row>~%")
                      ))))
                  (current-module))
(format docport "</tbody></tgroup></informaltable>~%")
(flush-all-ports)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]