generate html from lisp
Go to file
2024-09-03 06:57:41 -07:00
src mark blog as broken 2024-09-03 06:57:41 -07:00
templates fix mispelling; specify compile time in footer 2024-09-03 06:51:08 -07:00
.gitignore add most importtant pages 2024-09-01 14:29:08 -07:00
exec.lisp add most importtant pages 2024-09-01 14:29:08 -07:00
gen.lisp add most importtant pages 2024-09-01 14:29:08 -07:00
html.lisp initial 2024-08-26 21:40:45 -07:00
readme.md fix readme 2024-08-26 21:47:28 -07:00

htmlgen

tool for generating html from lisp code.
used for natalieee.net.
built around https://gist.github.com/markasoftware/ab357f1b967b3f656d026e33fec3bc0e

useage

templates/: used for templates
src/: documents in lisp
out/: where html will be written

to compile, run {clisp,sbcl} gen.lisp

example

templates/page.lisp for natalieee.net

(load "./templates/header.lsp")
(load "./templates/footer.lsp")

(defun page (title html)
    `(html (:lang "en") 
           (head ()
                 (meta (:http-equiv "content-type" :content "text/html; charset=utf-8"))
                 (meta (:name "viewport" :content "width=device-width, initial-scale=1"))
                 (link (:rel "stylesheet" :href "/style.css"))
                 (title () ,title))
           (body () 
                 ,(header)
                 (main () 
                       ,html)
                 ,(footer))))

example page:

; this would have a path of src/example.lisp or similar
(defun html ()
    (page "example" '(h1 () "example")))