diff --git a/tool/md2html/README.md b/tool/md2html/README.md index 3cf20d57b0..fa428029ff 100644 --- a/tool/md2html/README.md +++ b/tool/md2html/README.md @@ -1 +1,6 @@ -- \ No newline at end of file +This directory contains the pandoc template used to render the markdown files in this repository. + +To render a specific file, you need to run the following command: +``` +pandoc --from commonmark_x input_file --output=output_file --template=template.html --lua-filter=links-to-html.lua +``` diff --git a/tool/md2html/links-to-html.lua b/tool/md2html/links-to-html.lua new file mode 100644 index 0000000000..8240a15d24 --- /dev/null +++ b/tool/md2html/links-to-html.lua @@ -0,0 +1,4 @@ +function Link(el) + el.target = string.gsub(el.target, "%.md", ".html") + return el +end diff --git a/tool/md2html/style.css b/tool/md2html/style.css new file mode 100644 index 0000000000..9f697ea374 --- /dev/null +++ b/tool/md2html/style.css @@ -0,0 +1,26 @@ +table { + border-collapse: collapse; +} + +table > thead th { + border: 1px solid black; + border-bottom: 2px solid black; +} + +td { + border: 1px solid black; + padding: 0.8em; +} + +img { + max-width: 100%; +} + +summary > * { + /* + * Make summary display on the same line, instead of + * splitting into multiple lines + */ + + display: inline-flex; +} \ No newline at end of file diff --git a/tool/md2html/template.html b/tool/md2html/template.html new file mode 100644 index 0000000000..9f5f014ad8 --- /dev/null +++ b/tool/md2html/template.html @@ -0,0 +1,11 @@ + + + + + + + + + $body$ + + \ No newline at end of file