Compare commits
3 Commits
39ab9edd25
...
2d6d1294d4
Author | SHA1 | Date |
---|---|---|
TakeV | 2d6d1294d4 | |
TakeV | 4835576f46 | |
TakeV | 97a42a6b2b |
|
@ -1,4 +1,11 @@
|
||||||
(use-modules (srfi srfi-9))
|
(define-module (guile-docs docs)
|
||||||
|
#:use-module (srfi srfi-9)
|
||||||
|
#:export (make-doc
|
||||||
|
doc?
|
||||||
|
doc-module
|
||||||
|
doc-symbol
|
||||||
|
doc-documentation
|
||||||
|
docs-in-module))
|
||||||
|
|
||||||
(define-record-type <doc>
|
(define-record-type <doc>
|
||||||
(make-doc module symbol documentation)
|
(make-doc module symbol documentation)
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
;; todo: module
|
(define-module (guile-docs html templates)
|
||||||
|
#:use-module (guile-docs docs))
|
||||||
|
|
||||||
(define (overall-wrapper content)
|
(define (overall-wrapper content)
|
||||||
`(html
|
`(html
|
||||||
(link (@ (rel "stylesheet")
|
(link (@ (rel "stylesheet")
|
||||||
|
@ -21,3 +23,24 @@
|
||||||
(li "srfi"))))
|
(li "srfi"))))
|
||||||
,content
|
,content
|
||||||
(footer (p (i "powered by solarpunks.")))))))
|
(footer (p (i "powered by solarpunks.")))))))
|
||||||
|
|
||||||
|
(define index-page
|
||||||
|
(overall-wrapper
|
||||||
|
'(main
|
||||||
|
(h1 "Welcome")
|
||||||
|
(p "This is GuileDocs."))))
|
||||||
|
|
||||||
|
(define (render-doc doc)
|
||||||
|
`((hgroup
|
||||||
|
(h1 ,(doc-symbol doc))
|
||||||
|
(p "In " ,(doc-module doc)))
|
||||||
|
(p ,(or (doc-documentation doc) ""))))
|
||||||
|
|
||||||
|
(define (render-module module)
|
||||||
|
(let ((docs (docs-in-module module)))
|
||||||
|
(overall-wrapper
|
||||||
|
`(main ,(map render-doc docs)))))
|
||||||
|
|
||||||
|
(define test-module (resolve-interface '(srfi srfi-9)))
|
||||||
|
(define (test-rendering)
|
||||||
|
(render-module test-module))
|
11
hall.scm
11
hall.scm
|
@ -13,13 +13,16 @@
|
||||||
(files (libraries
|
(files (libraries
|
||||||
((directory
|
((directory
|
||||||
"guile-docs"
|
"guile-docs"
|
||||||
((scheme-file "docs") (scheme-file "reflection")))
|
((directory "html" ((scheme-file "templates")))
|
||||||
(scheme-file "guile-docs")))
|
(scheme-file "reflection")
|
||||||
|
(scheme-file "docs")))))
|
||||||
(tests ())
|
(tests ())
|
||||||
(programs
|
(programs
|
||||||
((directory
|
((scheme-file "guile-docs")
|
||||||
|
(directory
|
||||||
"scripts"
|
"scripts"
|
||||||
((text-file "launch-dev-shell")))))
|
((text-file "launch-dev-shell")
|
||||||
|
(text-file "guile-repl")))))
|
||||||
(documentation
|
(documentation
|
||||||
((directory "doc" ((texi-file "guile-docs")))
|
((directory "doc" ((texi-file "guile-docs")))
|
||||||
(text-file "COPYING")
|
(text-file "COPYING")
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
;; TODO: move to modules - need to set up pre-inst-env or w/e
|
|
||||||
(load "overall-wrapper.scm")
|
|
||||||
|
|
||||||
(overall-wrapper
|
|
||||||
'(main
|
|
||||||
(h1 "Welcome")
|
|
||||||
(p "This is GuileDocs.")))
|
|
|
@ -1,18 +0,0 @@
|
||||||
(load "overall-wrapper.scm")
|
|
||||||
|
|
||||||
(load "../guile-docs/docs.scm")
|
|
||||||
|
|
||||||
(define (render-module module)
|
|
||||||
(let ((docs (docs-in-module module)))
|
|
||||||
(overall-wrapper
|
|
||||||
`(main ,(map render-doc docs)))))
|
|
||||||
|
|
||||||
|
|
||||||
(define (render-doc doc)
|
|
||||||
`((hgroup
|
|
||||||
(h1 ,(doc-symbol doc))
|
|
||||||
(p "In " ,(doc-module doc)))
|
|
||||||
(p ,(or (doc-documentation doc) ""))))
|
|
||||||
|
|
||||||
|
|
||||||
(render-module (resolve-interface '(srfi srfi-19)))
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
guile --listen -L .
|
Loading…
Reference in New Issue