meow
This commit is contained in:
parent
93fd0e02ad
commit
6df697cf26
|
@ -3,7 +3,7 @@
|
|||
(require racket/list racket/match racket/runtime-path racket/string xml
|
||||
"../util.rkt")
|
||||
|
||||
(define-runtime-path *js-path* "./mathml-render.js")
|
||||
(define-runtime-path *js-path* "mathml-render.js")
|
||||
|
||||
(provide transform-xexprs scss-files)
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
|||
(map transform-xexpr xexprs))
|
||||
|
||||
(define (run-mathjax source block?)
|
||||
(define out-str (run-external (list "/usr/bin/env" "node" (path->string *js-path*)) source))
|
||||
(define out-str (run-external (list "node" (path->string *js-path*)) source))
|
||||
|
||||
(match-define (list 'math attrs bodies ...) (string->xexpr out-str))
|
||||
`(math ,(cons (list 'display (if block? "block" "inline"))
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
(define (run-pygments lang source)
|
||||
(define out-str
|
||||
(run-external (list "/usr/bin/env" "python3" (path->string *python-path*) lang) source))
|
||||
(run-external (list "python3" (path->string *python-path*) lang) source))
|
||||
(string->xexpr out-str))
|
||||
|
||||
(define (transform-xexpr xexpr)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
(prefix-in sass: sass)
|
||||
(prefix-in mathml: "ext-mathml/main.rkt")
|
||||
(prefix-in syntax: "ext-syntax/main.rkt")
|
||||
(prefix-in article: "templates/article.html.rkt"))
|
||||
(prefix-in page: "templates/page.html.rkt"))
|
||||
|
||||
(struct input-doc [metadata text] #:transparent)
|
||||
(struct ir-doc [metadata html] #:transparent)
|
||||
|
@ -107,7 +107,7 @@
|
|||
(define content-toc (toc content))
|
||||
|
||||
(define document
|
||||
(article:execute
|
||||
(page:execute
|
||||
(hash 'metadata md
|
||||
'content-toc content-toc
|
||||
'content content)))
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
()
|
||||
(!HTML-COMMENT () " this page made with: trans rights 🏳️⚧️ ")
|
||||
(meta ([charset "utf-8"]))
|
||||
(title () ,(metadata-ref+ metadata 'title "<untitled article>"))
|
||||
(title () ,(metadata-ref+ metadata 'title "<untitled page>"))
|
||||
(meta ([name "viewport"] [content "width=device-width, initial-scale=1"]))
|
||||
,@(match (metadata-ref+ metadata 'summary)
|
||||
[#f '()]
|
||||
|
@ -20,10 +20,7 @@
|
|||
[#f '()]
|
||||
[(list yn mn dn)
|
||||
`((meta ([name "DC.Date.created"]
|
||||
[content ,(format "~a-~a-~a"
|
||||
(~r yn #:min-width 4 #:pad-string "0")
|
||||
(~r mn #:min-width 2 #:pad-string "0")
|
||||
(~r dn #:min-width 2 #:pad-string "0"))])))])
|
||||
[content ,(format "~a-~a-~a" (~r/pad yn 4) (~r/pad mn 2) (~r/pad dn 2))])))])
|
||||
(meta ([name "generator"] [content "meow meow meow meow"]))
|
||||
;<link rel="shortcut icon" type="image/png" href="haskal.png"/>
|
||||
(link ([rel "stylesheet"] [type "text/css"] [href "index.css"])))
|
8
util.rkt
8
util.rkt
|
@ -1,10 +1,14 @@
|
|||
#lang racket/base
|
||||
|
||||
(require racket/string racket/port)
|
||||
(require racket/format racket/string racket/port)
|
||||
|
||||
(provide run-external)
|
||||
(provide ~r/pad run-external)
|
||||
|
||||
(define (~r/pad num pad-to)
|
||||
(~r num #:min-width pad-to #:pad-string "0"))
|
||||
|
||||
(define (run-external argv source)
|
||||
(printf "running external program: ~a\n" argv)
|
||||
(define-values [proc out in err]
|
||||
(apply subprocess #f #f #f "/usr/bin/env" argv))
|
||||
(define out-str #f)
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
#lang racket/base
|
||||
|
||||
(require racket/base racket/format racket/list racket/match racket/string
|
||||
"defs.rkt"
|
||||
"defs.rkt" "util.rkt"
|
||||
syntax/parse syntax/parse/define racket/stxparam
|
||||
(for-syntax racket/base racket/match racket/set))
|
||||
|
||||
(provide (rename-out [x:#%module-begin #%module-begin]
|
||||
[x:#%top #%top])
|
||||
(except-out (all-from-out racket/base racket/format racket/list racket/match racket/string
|
||||
"defs.rkt")
|
||||
"defs.rkt" "util.rkt")
|
||||
#%module-begin #%top))
|
||||
|
||||
(define-syntax-parameter template-id #f)
|
||||
|
|
Loading…
Reference in New Issue