https://github.com/pirtleshell/lanex-renderer
markdown parser for Laniakean.com
https://github.com/pirtleshell/lanex-renderer
Last synced: 11 months ago
JSON representation
markdown parser for Laniakean.com
- Host: GitHub
- URL: https://github.com/pirtleshell/lanex-renderer
- Owner: pirtleshell
- License: mit
- Created: 2017-02-05T18:44:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-05T23:43:02.000Z (over 9 years ago)
- Last Synced: 2025-06-03T20:58:48.361Z (about 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lanex-renderer
The markdown-it renderer used by [Laniakean.com](https://laniakean.com/).
## What
This renderer is used in a webpack markdown loader to render markdown files into React components. It has the following features:
* preserve contents in blocks fenced with `@@@`, useful for containing react components
* escapes code blocks so that `{` and `}` are replaced with `{'{'}` and `{'}'}`
* tables open with class `table table-responsive`
* style tags are replaces with a React-acceptable JSON string of styling
* relative links are rendered with `Link` instead of a regular `a`
* some custom inputs...
It uses the following plugins:
* markdown-it-math
* markdown-it-attrs
* markdown-it-abbr
* markdown-it-footnote
* markdown-it-ins
* markdown-it-sub
* markdown-it-sup
* markdown-it-emoji
* markdown-it-container
* markdown-it-deflist
* markdown-it-table-of-contents
* markdown-it-anchor
## Test
```sh
$ npm test
links
when relative
✓ render in
when absolute
✓ render in when absolute
mailto:
✓ renders as absolute
highlight
✓ escapes curly brackets properly
special containers
under-construction
✓ shoud render the under construciton box
render
✓ should preserve contents without a paragraph
✓ parses with indents
tables
✓ style attr renders properly
8 passing (75ms)
```
## License
This is by [Robert Pirtle](https://pirtle.xyz). Its license is [MIT](https://choosealicense.com/licenses/mit/)