Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/markdown-it-rust/markdown-it-plugins.rs

A markdown-it.rs plugin to process front matter containers
https://github.com/markdown-it-rust/markdown-it-plugins.rs

markdown-it-plugin

Last synced: 3 days ago
JSON representation

A markdown-it.rs plugin to process front matter containers

Awesome Lists containing this project

README

        

# markdown-it-plugins.rs


markdown-it-plugins icon

Monorepo of plugins for [markdown-it.rs](https://crates.io/crates/markdown-it):

- [markdown-it-front-matter](crates/front_matter/README.md)
- [markdown-it-footnote](crates/footnote/README.md)
- [markdown-it-tasklist](crates/tasklist/README.md)
- [markdown-it-heading-anchors](crates/heading_anchors/README.md)
- [markdown-it-autolink](crates/autolink/README.md)
- [markdown-it-deflist](crates/deflist/README.md)
- [markdown-it-gfm](crates/gfm/README.md)

More to come... (hopefully, many from [mdit-py-plugins](https://github.com/executablebooks/mdit-py-plugins))

Also utility crates:

- [github-slugger](crates/github_slugger/README.md)
- [gfm-autolinks](crates/gfm_autolinks/README.md)

## Development

Feedback on the code is always welcome!

Use [pre-commit](https://pre-commit.com/) to run checkers and formatters before committing:

```bash
git add -A
pre-commit run --all
```

## Release

Use [cargo-release](https://github.com/crate-ci/cargo-release) to release.
(maybe move to cargo-smart-release in the future)

## Notes

For translating markdown-it plugins to rust, here are some useful notes:

- `state.bMarks[startLine] + state.tShift[startLine]` is equivalent to `state.line_offsets[line].first_nonspace`
- `state.eMarks[startLine]` is equivalent to `state.line_offsets[line].line_end`
- `state.sCount[line]` is equivalent to `state.line_offsets[line].indent_nonspace`
- `state.sCount[line] - state.blkIndent` is equivalent to `state.line_indent(state.line)`