Commit 98957d95 authored by Antoine Martin's avatar Antoine Martin
Browse files

Format markdown READMEs before adding them to html

parent ffb8d1df
......@@ -81,6 +81,14 @@
:if-exists :supersede)
,@body)))
(defun format-readme (readme)
(let ((readme-txt (file-to-string readme)))
(if (string= (pathname-type readme) "md")
(with-output-to-string (out)
(parse-string-and-print-to-stream readme-txt out))
(format nil "<pre style=\"white-space: pre-wrap;\">~%~A~%</pre>"
readme-txt))))
(defun use-readme-intro (html-pathname readme-pathname)
(read-write-file (html-pathname html-text stream)
(write-sequence
......@@ -88,6 +96,5 @@
"\\<h2 class=\\\"chapter\\\"\\>1 Introduction\\<\\/h2\\>\\n"
html-text
(list :match
(format nil "<pre style=\"white-space: pre-wrap;\">~%~A~%</pre>"
(file-to-string readme-pathname))))
(format-readme readme-pathname)))
stream)))
(asdf:defsystem quickref
:author "Antoine Martin"
:depends-on (:quicklisp :alexandria :net.didierverna.declt :cl-ppcre)
:depends-on (:quicklisp :alexandria :net.didierverna.declt
:cl-ppcre :3bmd)
:serial t
:components ((:file "quickref")
(:file "qrmapper")
......
......@@ -7,6 +7,8 @@
:native-namestring)
(:import-from :cl-ppcre
:regex-replace)
(:import-from :3bmd
:parse-string-and-print-to-stream)
(:export :print-primary-systems
:get-primary-system-name
:from-quickref-dir
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment