Markdown-to-Website Generator, GitHub README style
MIT License
mark-applier
Markdown-to-Website Generator, GitHub README style
Generate a barebones GitHub-readme-themed website from markdown.
https://suchipi.github.io/mark-applier/ has been generated from this README.
<kbd>
and etc).md
files (changes ending .md
to .html
in links to the same origin)npx
program.To generate README.html
from the contents of README.md
:
$ npx mark-applier --input README.md --title "My Awesome Page" --output README.html
You can alternatively use yaml frontmatter to specify the page title instead of --title
:
---
title: My Awesome Page
---
# My Awesome Page
...
Outputs the raw rendered markdown, without the enclosing page HTML:
$ npx mark-applier --input README.md --raw --output README.html
By using --css
to get the css and --raw
to get the raw html, you can use your own page template instead of the one provided by mark-applier.
If you're going to use this with the CSS provided by mark-applier, you should put that raw HTML inside of an element with the class name "markdown-body", like so:
<article class="markdown-body">
<!-- raw html goes here -->
</article>
You can also add the class name "light-theme" or the class name "dark-theme" to override the default theme (which is whatever the user's OS uses). You can put this class on the .markdown-body
element or any of its parent elements.
Outputs the CSS from the page, without any of the HTML.
$ npx mark-applier --css > styles.css
By using --css
to get the css and --raw
to get the raw html, you can use your own page template instead of the one provided by mark-applier.
mark-applier adds target="_blank"
and some other attributes to <a>
elements when they appear to be linking to an external page. To improve the accuracy of this "appear to be linking to an external page" heuristic, you can specify the origin (protocol and domain name) that the document will appear on. Specify it either in the yaml frontmatter's origin
key or via the CLI option --origin
:
$ npx mark-applier --input README.md --origin https://example.com --output README.html
MIT