summaryrefslogtreecommitdiff
path: root/module/texinfo
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-12-18 13:31:02 +0100
committerAndy Wingo <wingo@pobox.com>2009-12-21 00:01:49 +0100
commitc55cb58ac15b61eac574d8adafb08bc32f2bc8c1 (patch)
tree9fd898c22c4df9cc71600de5cfb048818204370a /module/texinfo
parent05c29c5abc79bc1ceb7999176252debf0a6811e4 (diff)
downloadguile-c55cb58ac15b61eac574d8adafb08bc32f2bc8c1.tar.gz
integrate guile-lib docs
Diffstat (limited to 'module/texinfo')
-rw-r--r--module/texinfo/reflection.scm40
1 files changed, 39 insertions, 1 deletions
diff --git a/module/texinfo/reflection.scm b/module/texinfo/reflection.scm
index bda1830ea..d88bd37c8 100644
--- a/module/texinfo/reflection.scm
+++ b/module/texinfo/reflection.scm
@@ -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