[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
automatic documentation of type-p-name-alist
From: |
Mark Polesky |
Subject: |
automatic documentation of type-p-name-alist |
Date: |
Tue, 20 Apr 2010 23:56:03 -0700 (PDT) |
For a while, some of us have been wanting to generate the
valid music-function type-predicates automatically. I tried
something but got stuck almost immediately. I don't know if
this is the right approach, but by adding these two scheme
definitions just after the (set! type-p-name-alist ...)
block in scm/lily.scm, a texinfo string is stored in the
scheme variable "typecheck-doc-table".
For the scheme code below, I added a space after any
double-quote that is immediately followed by an at-sign (to
sidestep the annnoying address@hidden archive mangling).
Though in the attached patch, I didn't add these spaces.
Also, the columns in the table are reversed for now, since
type-p-name-alist is sorted by predicate (not by the
description docstring). I'll either need to modify the
(make-doc-typecheck-row ...) procedure so that the columns
are switched, or reword the doc sentences leading up to the
table (neither is a big problem).
The question is, is this the right approach? Is there a way
for the texinfo doc files to access the typecheck-doc-table
string so that that the table appears as if it were inline
texinfo?
Thanks.
- Mark
* * * * * * * * * * *
(define (make-doc-typecheck-row entry)
(string-append
;; remove the space between " and @...
" @item @code{"
(symbol->string (procedure-name (car entry)))
"} @tab "
(cdr entry)
"\n"))
(define typecheck-doc-table
(string-append
;; remove the spaces between " and @...
" @multitable @columnfractions .33 .66\n"
" @headitem Type predicate @tab Description\n"
(apply string-append
(map make-doc-typecheck-row type-p-name-alist))
" @end multitable\n"))
0001-lily.scm-Generate-typecheck-doc-table-texinfo-string.patch
Description: Text Data
- automatic documentation of type-p-name-alist,
Mark Polesky <=