1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-15 08:10:17 +02:00

integrate guile-lib docs

This commit is contained in:
Andy Wingo 2009-12-18 13:31:02 +01:00
parent 05c29c5abc
commit c55cb58ac1
7 changed files with 146 additions and 5 deletions

View file

@ -47,7 +47,8 @@
package-stexi-standard-menu
package-stexi-extended-menu
package-stexi-standard-prologue
package-stexi-documentation))
package-stexi-documentation
package-stexi-documentation-for-include))
;; List for sorting the definitions in a module
(define defs
@ -525,4 +526,41 @@ useful to define a @code{#:docs-resolver} argument."
scripts)
,@epilogue))
(define* (package-stexi-documentation-for-include modules module-descriptions
#:key
(module-stexi-documentation-args '()))
"Create stexi documentation for a @dfn{package}, where a
package is a set of modules that is released together.
@var{modules} is expected to be a list of module names, where a
module name is a list of symbols. Returns an stexinfo fragment.
Unlike @code{package-stexi-documentation}, this function simply produces
a menu and the module documentations instead of producing a full texinfo
document. This can be useful if you write part of your manual by hand,
and just use @code{@@include} to pull in the automatically generated
parts.
@var{module-stexi-documentation-args} is an optional argument that, if
given, will be added to the argument list when
@code{module-texi-documentation} is called. For example, it might be
useful to define a @code{#:docs-resolver} argument."
(define (make-entry node description)
`("* " ,node "::"
,(make-string (max (- 21 (string-length node)) 2) #\space)
,@description "\n"))
`(*fragment*
(menu
,@(append-map (lambda (modname desc)
(make-entry (module-name->node-name modname)
desc))
modules
module-descriptions))
,@(append-map (lambda (modname)
(stexi->chapter
(apply module-stexi-documentation
modname
module-stexi-documentation-args)))
modules)))
;;; arch-tag: bbe2bc03-e16d-4a9e-87b9-55225dc9836c