Merge pull request 'charli-branch' (#1) from charli-branch into main
Reviewed-on: #1
This commit is contained in:
commit
8efcd9bca3
|
@ -0,0 +1,24 @@
|
||||||
|
(define-module (guile-docs docs)
|
||||||
|
#:use-module (srfi srfi-9)
|
||||||
|
#:export (docs-in-module))
|
||||||
|
|
||||||
|
(define-record-type <doc>
|
||||||
|
(make-doc module symbol documentation)
|
||||||
|
doc?
|
||||||
|
(module doc-module)
|
||||||
|
(symbol doc-symbol)
|
||||||
|
(documentation doc-documentation))
|
||||||
|
|
||||||
|
|
||||||
|
(define (docs-in-module module)
|
||||||
|
"Returns a list of <doc> 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))
|
4
hall.scm
4
hall.scm
|
@ -11,7 +11,9 @@
|
||||||
(dependencies `())
|
(dependencies `())
|
||||||
(skip ())
|
(skip ())
|
||||||
(files (libraries
|
(files (libraries
|
||||||
((directory "src" ((scheme-file "reflection")))
|
((directory
|
||||||
|
"guile-docs"
|
||||||
|
((scheme-file "docs") (scheme-file "reflection")))
|
||||||
(scheme-file "guile-docs")))
|
(scheme-file "guile-docs")))
|
||||||
(tests ())
|
(tests ())
|
||||||
(programs ())
|
(programs ())
|
||||||
|
|
Loading…
Reference in New Issue