| 1 |
# Comrak |
| 2 |
|
| 3 |
Comrak is a [CommonMark] and [GitHub Flavored Markdown] compatible parser and renderer, written in Rust. |
| 4 |
|
| 5 |
It is [developed on GitHub] by a community of contributors, and released under the [BSD 2-clause license], forever[^no-cla], for use by all. |
| 6 |
|
| 7 |
[CommonMark]: https://commonmark.org/ |
| 8 |
[GitHub Flavored Markdown]: https://github.github.com/gfm/ |
| 9 |
[developed on GitHub]: https://github.com/kivikakk/comrak |
| 10 |
[BSD 2-clause license]: https://github.com/kivikakk/comrak/blob/main/COPYING |
| 11 |
|
| 12 |
[^no-cla]: Comrak intentionally does not use a [Contributor License Agreement] --- every contributor retains copyright on their contributions. |
| 13 |
|
| 14 |
[Contributor License Agreement]: https://en.wikipedia.org/wiki/Contributor_license_agreement |
| 15 |
|
| 16 |
|
| 17 |
## Features |
| 18 |
|
| 19 |
* Compatible with [CommonMark 0.31.2] by default. |
| 20 |
* One option to toggle on all [GitHub Flavored Markdown] extensions (or enable them separately). |
| 21 |
* Many additional [extensions] developed by the community. |
| 22 |
* Fine-grained [parse] and [render] options. |
| 23 |
* [Pluggable] syntax highlighting for code blocks. |
| 24 |
* [Custom formatter] support to override the rendering of any node type. |
| 25 |
|
| 26 |
[CommonMark 0.31.2]: https://spec.commonmark.org/0.31.2/ |
| 27 |
[extensions]: https://docs.rs/comrak/latest/comrak/options/struct.Extension.html |
| 28 |
[parse]: https://docs.rs/comrak/latest/comrak/options/struct.Parse.html |
| 29 |
[render]: https://docs.rs/comrak/latest/comrak/options/struct.Render.html |
| 30 |
[Pluggable]: https://github.com/kivikakk/comrak#plugins |
| 31 |
[Custom formatter]: https://docs.rs/comrak/latest/comrak/macro.create_formatter.html |
| 32 |
|
| 33 |
|
| 34 |
## Usage |
| 35 |
|
| 36 |
Comrak can be used directly on the command-line or as part of a batch processing pipeline, and is available pre-built on [many platforms]. |
| 37 |
|
| 38 |
It can also be used as a library in Rust as a Cargo dependency, or with [bindings to other languages]. |
| 39 |
The WASM target lets it be used [directly in webpages]. |
| 40 |
|
| 41 |
This webpage is [created with Comrak] by stitching together three elements: |
| 42 |
|
| 43 |
* [`header.html`] |
| 44 |
* [`index.md`] converted with `--header-id-prefix "" --smart -e footnotes` |
| 45 |
* [`footer.html`] |
| 46 |
|
| 47 |
The CLI help for the latest version is available in the [README], and the Rust documentation is on [docs.rs]. |
| 48 |
|
| 49 |
[many platforms]: https://github.com/kivikakk/comrak#cli |
| 50 |
[bindings to other languages]: #bindings |
| 51 |
[directly in webpages]: https://gitlab-org.gitlab.io/ruby/gems/gitlab-glfm-markdown/ |
| 52 |
[created with Comrak]: Makefile |
| 53 |
[`header.html`]: https://github.com/kivikakk/comrak/blob/main/www/header.html |
| 54 |
[`index.md`]: https://github.com/kivikakk/comrak/blob/main/www/index.md?plain=1 |
| 55 |
[`footer.html`]: https://github.com/kivikakk/comrak/blob/main/www/footer.html |
| 56 |
[README]: https://github.com/kivikakk/comrak#usage |
| 57 |
[docs.rs]: https://docs.rs/comrak/latest/comrak/ |
| 58 |
|
| 59 |
|
| 60 |
## Bindings |
| 61 |
|
| 62 |
* [Commonmarker], [gitlab-glfm-markdown] (Ruby) |
| 63 |
* [MDEx] (Elixir) |
| 64 |
* [comrak], [comrak-ext] (Python) |
| 65 |
* [comrak-wasm] (TypeScript) |
| 66 |
|
| 67 |
[Commonmarker]: https://github.com/gjtorikian/commonmarker |
| 68 |
[gitlab-glfm-markdown]: https://gitlab.com/gitlab-org/ruby/gems/gitlab-glfm-markdown |
| 69 |
[MDEx]: https://mdelixir.dev |
| 70 |
[comrak]: https://github.com/lmmx/comrak |
| 71 |
[comrak-ext]: https://github.com/Martin005/comrak-ext |
| 72 |
[comrak-wasm]: https://github.com/nberlette/comrak-wasm |
| 73 |
|
| 74 |
|
| 75 |
## Who uses Comrak? |
| 76 |
|
| 77 |
* [crates.io] and [docs.rs] |
| 78 |
* [GitLab] |
| 79 |
* [Deno] |
| 80 |
* [Reddit] |
| 81 |
* [Lockbook] |
| 82 |
* [many] [more!] |
| 83 |
|
| 84 |
[crates.io]: https://crates.io/ |
| 85 |
[docs.rs]: https://docs.rs/ |
| 86 |
[GitLab]: https://gitlab.com/ |
| 87 |
[Deno]: https://deno.com/ |
| 88 |
[Reddit]: https://www.reddit.com/ |
| 89 |
[Lockbook]: https://lockbook.net/ |
| 90 |
[many]: https://github.com/kivikakk/comrak/network/dependents |
| 91 |
[more!]: https://crates.io/crates/comrak/reverse_dependencies |
| 92 |
|
| 93 |
|
| 94 |
## Questions? Commits? Cat pictures? |
| 95 |
|
| 96 |
You can contact the maintainers and community [on GitHub], or you can |
| 97 |
email the author at [`[email protected]`](mailto:[email protected]). |
| 98 |
Please report security issues to that email address. |
| 99 |
|
| 100 |
Contributions are **highly encouraged**, and we would love to help you |
| 101 |
through the process. We practice [Optimistic Merging] as described by |
| 102 |
Peter Hintjens. We have a [Code of Conduct] which forms the basis of how |
| 103 |
we treat one another. |
| 104 |
|
| 105 |
If you have a GitHub account, you are welcome to use its interface to |
| 106 |
report issues, open pull requests, and [privately report security issues]. |
| 107 |
If not, you are very welcome to discuss and contribute by email, and a |
| 108 |
maintainer will make those actions on your behalf, attributed however you |
| 109 |
like. |
| 110 |
|
| 111 |
[on GitHub]: https://github.com/kivikakk/comrak |
| 112 |
[Optimistic Merging]: http://hintjens.com/blog:106 |
| 113 |
[Code of Conduct]: https://github.com/kivikakk/comrak/blob/main/CODE_OF_CONDUCT.md |
| 114 |
[privately report security issues]: https://github.com/kivikakk/comrak/security/advisories/new |
| 115 |
|
| 116 |
--- |
| 117 |
|
| 118 |
|
| 119 |
|