This commit is contained in:
xenia 2021-06-06 02:28:40 -04:00
parent ad5cdfb82c
commit cb261d8290
1 changed files with 11 additions and 7 deletions

View File

@ -1,32 +1,36 @@
#lang racket #lang racket
(require markdown markdown/display-xexpr (require markdown markdown/display-xexpr markdown/toc
(prefix-in mathml: "ext-mathml/main.rkt") (prefix-in mathml: "ext-mathml/main.rkt")
(prefix-in syntax: "ext-syntax/main.rkt")) (prefix-in syntax: "ext-syntax/main.rkt"))
(define input (port->string (current-input-port))) (define input (port->string (current-input-port)))
(define output-raw (parse-markdown input)) (define output-raw (parse-markdown input))
(define output-cooked (mathml:transform-xexprs (syntax:transform-xexprs output-raw))) (define output-cooked (mathml:transform-xexprs (syntax:transform-xexprs output-raw)))
(define output-toc (toc output-cooked))
(define styles (string-append (mathml:get-styles) (syntax:get-styles))) (define styles (string-append (mathml:get-styles) (syntax:get-styles)))
(define document (define document
`(html `(html
((lang "en")) ([lang "en"])
(head (head
() ()
(meta ((charset "utf-8"))) (meta ([charset "utf-8"]))
(title () "meow meow meow") (title () "meow meow meow")
(meta ((name "viewport") (content "width=device-width, initial-scale=1"))) (meta ([name "viewport"] [content "width=device-width, initial-scale=1"]))
(meta ((name "description") (content "prototype racket markdown system uwu"))) (meta ([name "description"] [content "prototype racket markdown system uwu"]))
;<link rel="shortcut icon" type="image/png" href="haskal.png"/> ;<link rel="shortcut icon" type="image/png" href="haskal.png"/>
(style ((type "text/css")) ,styles)) (style ([type "text/css"]) ,styles))
(body (body
() ()
(nav
()
,output-toc)
(main (main
() ()
,@output-cooked) ,@output-cooked)
(div ((style "display: none")) "__X_MATHJAX_POLYFILL_PLACEHOLDER__")))) (div ([style "display: none"]) "__X_MATHJAX_POLYFILL_PLACEHOLDER__"))))
(display "<!doctype html>") (display "<!doctype html>")
(display-xexpr document) (display-xexpr document)