A feature-rich markdown renderer
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.
 
Trivernis 6f39c36f56 Added commands, styles, fixes
- added [!newpage] to start a new page (for pdf)
- added pdf exports supported by puppeteer
- added styles for math and code highlighting
- fixed circular imports
- added CHANGELOG
- switched to argparse for argument parsing
- switched to gulp for building
5 years ago
src Added commands, styles, fixes 5 years ago
.gitignore Initial commit 5 years ago
CHANGELOG.md Added commands, styles, fixes 5 years ago
README.md Added commands, styles, fixes 5 years ago
gulpfile.js Added commands, styles, fixes 5 years ago
package-lock.json Added commands, styles, fixes 5 years ago
package.json Added commands, styles, fixes 5 years ago
tsconfig.json Initial commit 5 years ago

README.md

markdown-super

Markdown-Super is a markkdown-parser using markdown it that allows including other markdown-documents and manage markdown-it plugins inside the document itself.

Commandline

usage: index.js [-h] [-w] [--pdf] file

Positional arguments:
  file         The file to render

Optional arguments:
  -h, --help   Show this help message and exit.
  -w, --watch  Watch files for changes
  --pdf        Output as pdf


Including other markdown documents

A document can be included by using

[!include]: path/to/file

Included documents can also use include. If there is a circular include, the include resulting in an endless loop is ignored.

Managing markdown-it plugins

The usage of a markdown-it plugin inside a document can be decleared by using

[!use]: plugin1, plugin2, plugin3

The plugin names are listed in the following table. Basically it is just the package name with the markdown-it removed:

module import name
markdown-it-footnote footnote
markdown-it-anchor anchor
markdown-it-mark mark
markdown-it-sub sub
markdown-it-attrs attrs
markdown-it-abbr abbr
markdown-it-checkbox checkbox
markdown-it-imsize imsize
markdown-it-highlightjs highlightjs
markdown-it-toc-done-right toc-done-right
markdown-it-smartarrows smartarrows
markdown-it-plantuml plantuml
markdown-it-mathjax mathjax
markdown-it-math math
markdown-it-div div

For example you can declare the use of markdown-it-emoji the following:

[!use]: emoji

Pages

You can manage the pages that are exported to the pdf. A new page can be started with:

[!newpage]

Note that this automatically includes markdown-it-div in your project. If you want to declare one page specifically, you need to declare the use of markdown-it-div ([!use]: div). Then you pages can be created like this:

::: page
Your page's content.
Warning: be careful not to put too much content in this environment
because it will be rendered as only ONE page in the pdf output.
:::