You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
typesetting/quad/quadwriter/markdown.rkt

45 lines
1.2 KiB
Racket

#lang debug racket/base
6 years ago
(require (for-syntax)
6 years ago
racket/list
racket/match
quadwriter/core
6 years ago
"tags.rkt"
6 years ago
"lang-helper.rkt")
(provide (all-defined-out)
6 years ago
#%app #%datum #%top-interaction
(all-from-out "tags.rkt"))
6 years ago
(define rsquo "")
(define rdquo "")
(define lsquo "")
(define ldquo "")
(define hellip "")
(define ndash "")
(define mdash "")
6 years ago
(define (doc-proc exprs)
(define strs (match exprs
[(? null?) '(" ")]
[strs strs]))
(root null (add-between strs (list pbr)
#:before-first (list pbr)
#:after-last (list pbr)
#:splice? #true)))
(make-mb doc-proc)
6 years ago
(module reader racket/base
6 years ago
(require syntax/strip-context
6 years ago
racket/port
6 years ago
(only-in markdown parse-markdown)
6 years ago
"lang-helper.rkt")
(provide (rename-out [rs read-syntax]))
6 years ago
(define (rs path-string p)
6 years ago
(define pt (xexpr->parse-tree (parse-markdown (port->string p))))
6 years ago
(strip-context
6 years ago
(with-syntax ([PATH-STRING path-string]
6 years ago
[PT pt])
6 years ago
#'(module _ quadwriter/markdown
6 years ago
PATH-STRING
6 years ago
. PT)))))