diff --git a/guile-docs/docs.scm b/guile-docs/docs.scm new file mode 100644 index 0000000..2d5c267 --- /dev/null +++ b/guile-docs/docs.scm @@ -0,0 +1,24 @@ +(define-module (guile-docs docs) + #:use-module (srfi srfi-9) + #:export (docs-in-module)) + +(define-record-type + (make-doc module symbol documentation) + doc? + (module doc-module) + (symbol doc-symbol) + (documentation doc-documentation)) + + +(define (docs-in-module module) + "Returns a list of for each symbol in module mod" + (module-map + (lambda (sym var) + (let* ((binding (variable-ref var)) + (proc (cond + ((procedure? binding) binding) + ((macro? binding) (macro-binding binding)) + (else #f))) + (docs (when (procedure? proc) (procedure-documentation proc)))) + (make-doc (module-name module) sym docs))) + module)) diff --git a/hall.scm b/hall.scm index 2868360..8099cc8 100644 --- a/hall.scm +++ b/hall.scm @@ -11,7 +11,9 @@ (dependencies `()) (skip ()) (files (libraries - ((directory "guile-docs" ((scheme-file "reflection"))) + ((directory + "guile-docs" + ((scheme-file "docs") (scheme-file "reflection"))) (scheme-file "guile-docs"))) (tests ()) (programs ())