Compare commits

...

3 Commits

Author SHA1 Message Date
TakeV 2d6d1294d4
Create templates file to handle rendering and move temp scripts into it
Create docs module
Add templates file to handle html wrapping and rendering
Remove temp rendering files
Add templates to hall file
2023-12-13 10:48:29 -05:00
TakeV 4835576f46
Conside guile-docs to be a program for hall 2023-12-13 10:05:16 -05:00
TakeV 97a42a6b2b
Add guile-repl script to quickly launch a guile repl
It also loads the project path and listens on the default port
2023-12-13 10:01:17 -05:00
6 changed files with 42 additions and 31 deletions

View File

@ -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>
(make-doc module symbol documentation)

View File

@ -1,4 +1,6 @@
;; todo: module
(define-module (guile-docs html templates)
#:use-module (guile-docs docs))
(define (overall-wrapper content)
`(html
(link (@ (rel "stylesheet")
@ -21,3 +23,24 @@
(li "srfi"))))
,content
(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))

View File

@ -13,13 +13,16 @@
(files (libraries
((directory
"guile-docs"
((scheme-file "docs") (scheme-file "reflection")))
(scheme-file "guile-docs")))
((directory "html" ((scheme-file "templates")))
(scheme-file "reflection")
(scheme-file "docs")))))
(tests ())
(programs
((directory
((scheme-file "guile-docs")
(directory
"scripts"
((text-file "launch-dev-shell")))))
((text-file "launch-dev-shell")
(text-file "guile-repl")))))
(documentation
((directory "doc" ((texi-file "guile-docs")))
(text-file "COPYING")

View File

@ -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.")))

View File

@ -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)))

3
scripts/guile-repl Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
guile --listen -L .