An extended markdown parser written in pure rust
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.
 
 
 
Go to file
trivernis 3c88632548 Improve section handling and add Checkboxes
Huge improvements to section handling by postprocessing elements and reordering them,
mergin with imports and so on to get a one-document output with no nesting errors.
5 years ago
src Improve section handling and add Checkboxes 5 years ago
.gitignore Add subtext parsing 5 years ago
Cargo.lock Improve section handling and add Checkboxes 5 years ago
Cargo.toml Improve section handling and add Checkboxes 5 years ago
LICENSE Create LICENSE 5 years ago
README.md Improve section handling and add Checkboxes 5 years ago
perf.data Encapsulate inline parsing 5 years ago

README.md

Snekdown - A wonderful markdown parser

This projects goal is to implement a fast markdown parser with an extended syntax fitted for my needs.

Usage

USAGE:
    snekdown [OPTIONS] <input> <output>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --format <format>     [default: html]

ARGS:
    <input>     
    <output>

Syntax

Images

Simple Syntax
!(url)

Extended syntax with a description
![description](url)

Extended syntax with metadata to specify the size
![description](url)[metadata]

Extended syntax with metadata and no description
!(url)[metadata]

Quotes

Simple (default) Syntax
> This is a quote

Multiline
> This is a 
> Multiline Quote

Quote with metadata (e.g. Author)
[author=Trivernis year=2020 display='{{author}} - {{year}}']> This is a quote with metadata

Imports

Imports can be used to import a different document to be attached to the main document. Imports are parsed via multithreading.

<[path]

Tables

Tables MUST start with a pipe character |

Standalone header:
| header | header | header

Header with rows
| header | header | header
|--------|--------|-------
| row    | row    | row

Placeholders

Placeholders can be used to insert special elements in a specific place. Placeholders are always case insensitive.

Insert the table of contents
[[TOC]]

Insert the current date
[[date]]

Insert the current time
[[time]]

Metadata

Additional metadata can be provided for some elements.

String value
[key = value]

String value
[key = "String value"]

Integer value
[key = 123]

Float value
[key = 1.23]

Boolean
[key] 

Boolean
[key = false]

Placeholder
[key = [[placeholder]]]

Formatting
[author = "The Great snek" date = [[date]] time = [[time]] display = "author - date at time"]

Usage

Hide a section (including subsections) in the TOC
#[toc-hidden] Section

Set the size of an image
!(url)[width = 42% height=auto]

Set the source of a quote
[author=Me date=[[date]] display="{{author}} - {{date}}"]> It's me

Set options for placeholders
[[toc]][ordered]

Centered Text

|| These two lines
|| are centered

Inline

*Italic*
**Bold**
~Striked~
_Underlined_
^Superscript^
`Monospace`

Roadmap

The end goal is to have a markdown language similar to LaTeX.

  • Checkboxes
  • Emojis (:emoji:)
  • Bibliography
  • Math
  • Figures
  • Text sizes
  • Colors
  • Cross References
  • Title pages
  • Glossary
  • EPUB Rendering (PDF is too hard)
  • Custom Elements via templates
  • Custom Stylesheets