Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metagn/margrave
Markdown dialect
https://github.com/metagn/margrave
articles html markdown nim parser pure
Last synced: about 1 month ago
JSON representation
Markdown dialect
- Host: GitHub
- URL: https://github.com/metagn/margrave
- Owner: metagn
- Created: 2020-10-01T08:30:53.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-21T03:14:01.000Z (about 1 year ago)
- Last Synced: 2024-05-01T22:24:09.419Z (7 months ago)
- Topics: articles, html, markdown, nim, parser, pure
- Language: Nim
- Homepage: https://metagn.github.io/margrave/browser/converter.html
- Size: 173 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# margrave
Tweakable parser for a dialect of markdown that generates an HTML-like
representation, which can be converted to HTML. Not stable.
[Try in browser](https://metagn.github.io/margrave/browser/converter.html).
[Docs](https://metagn.github.io/margrave/docs/margrave.html)Tested for C, JS and NimScript (so also VM).
Input file ref.mrg:
````markdown
To escape use \\# Heading1
## Heading2
### Heading3
#### Heading4
##### Heading5
###### Heading6####{heading-id} Heading (new, makes heading-id the id of this heading)
* Bullet points
+ Plus
- Minus1. Numbered list
2. Can be
4. Any number
. or just a dot (new),
can also indent> Blockquotes
>
> can _be_ **formatted**```
Code blocks
Have no formattingHTML & chars < automatically > escaped
```Inline formatting:
Link: [text](url)
[text **can have formatting**](url "tooltip text")
Image: ![](url)
![alt text (image doesnt load)](url "tooltip text")
Superscript (new): 4^(3) = 64
Subscript (new): a[n] = 2n + 1
Bold: **text**
Underline: __text__
italic: *text* _text_
Strikethrough: ~~text~~
Inline code (has formatting!): `text`
Checkboxes anywhere in the document, not just lists: [ ] [x]
Unformatted text with curly braces (new): {aaa **aaa** __aaa__}
Raw curly braces (HTML chars left unescaped): {! foo bar}
Nested curly braces: {aa {bb} cc {dd {ee}} ff}
Inline code without formatting: `{1 < 3 ? _ * 3 + 3 * _ + 2 ** 2 ** 2 : 4 & 2}`Inline HTML (no formatting inside, raw curly braces might be better):
a 1
a 2
b 1
b 2
````
outputs to ref.html:
```HTML
To escape use \
Heading1
Heading2
Heading3
Heading4
Heading5
Heading6
Heading (new, makes heading-id the id of this heading)
- Bullet points
- Plus
- Minus
- Numbered list
- Can be
- Any number
- or just a dot (new),
can also indent
Blockquotes
can be formatted
Code blocks
Have no formattingHTML & chars < automatically > escaped
Inline formatting:
Link: text
text can have formatting
Image:
Superscript (new): 43 = 64
Subscript (new): an = 2n + 1
Bold: text
Underline: text
italic: text text
Strikethrough: text
Inline code (has formatting!): text
Checkboxes anywhere in the document, not just lists:
Unformatted text with curly braces (new): aaa **aaa** __aaa__
Raw curly braces (HTML chars left unescaped): foo bar
Nested curly braces: aa {bb} cc {dd {ee}} ff
Inline code without formatting: 1 < 3 ? _ * 3 + 3 * _ + 2 ** 2 ** 2 : 4 & 2
Inline HTML (no formatting inside, raw curly braces might be better):
a 1
a 2
b 1
b 2
```