You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
curl.exe -A "MS" https://webinstall.dev/comrak | powershell
39
-
```
35
+
You can also find builds I've published in [GitHub Releases](https://github.com/kivikakk/comrak/releases), but they're limited to machines I have access to at the time of making them\ offers `curl | shell`-style installation of the latest of these for your OS.
40
36
41
37
## Usage
42
38
39
+
<details>
40
+
41
+
<summary>Click to expand the CLI <code>--help</code> output.
42
+
43
43
```console
44
44
$ comrak --help
45
+
```
46
+
47
+
</summary>
48
+
49
+
```
45
50
A 100% CommonMark-compatible GitHub Flavored Markdown parser and formatter
46
51
47
52
Usage: comrak [OPTIONS] [FILE]...
@@ -54,7 +59,7 @@ Options:
54
59
-c, --config-file <PATH>
55
60
Path to config file containing command-line arguments, or 'none'
56
61
57
-
[default: /home/runner/.config/comrak/config]
62
+
[default: /Users/kivikakk/.config/comrak/config]
58
63
59
64
-i, --inplace
60
65
To perform an in-place formatting
@@ -73,7 +78,11 @@ Options:
73
78
74
79
--gfm
75
80
Enable GitHub-flavored markdown extensions: strikethrough, tagfilter, table, autolink, and
76
-
tasklist. Also enables --github-pre-lang
81
+
tasklist. Also enables --github-pre-lang and --gfm-quirks
82
+
83
+
--gfm-quirks
84
+
Enables GFM-style quirks in output HTML, such as not nesting <strong> tags, which
85
+
otherwise breaks CommonMark compatibility
77
86
78
87
--relaxed-tasklist-character
79
88
Enable relaxing which character is allowed in a tasklists
For running benchmarks, you will need to [install hyperfine](https://github.com/sharkdp/hyperfine#installation) and optionally cmake.
203
-
204
-
If you want to just run the benchmark for `comrak`, with the current state of the repo, you can simply run
205
-
206
-
```bash
207
-
make bench-comrak
208
-
```
209
-
210
-
This will build comrak in release mode, and run benchmark on it. You will see the time measurements as reported by hyperfine in the console.
211
-
212
-
Makefile also provides a way to run benchmarks for `comrak` current state (with your changes), `comrak` main branch, [`cmark-gfm`](https://github.com/github/cmark-gfm), [`pulldown-cmark`](https://github.com/raphlinus/pulldown-cmark) and [`markdown-it.rs`](https://github.com/rlidwka/markdown-it.rs). For this you will need to install `cmake`. After that make sure that you have set-up the git submodules. In case you have not installed submodules when cloning, you can do it by running
213
-
214
-
```bash
215
-
git submodule update --init
216
-
```
217
-
218
-
After this is done, you can run
219
-
220
-
```bash
221
-
make bench-all
222
-
```
223
-
224
-
which will run benchmarks across all, and report the time take by each as well as relative time.
225
-
226
-
Apart from this, CI is also setup for running benchmarks when a pull request is first opened. It will add a comment with the results on the pull request in a tabular format comparing the 5 versions. After that you can manually trigger this CI by commenting `/run-bench` on the PR, this will update the existing comment with new results. Note benchmarks won't be automatically run on each push.
223
+
For a slightly more real-world example, see how I [generate my GitHub user README](https://github.com/kivikakk/kivikakk) from a base document with embedded YAML, which itself has embedded Markdown, or
224
+
[check out some of Comrak's dependents on crates.io](https://crates.io/crates/comrak/reverse_dependencies) or [on GitHub](https://github.com/kivikakk/comrak/network/dependents).
227
225
228
226
## Security
229
227
230
228
As with [`cmark`](https://github.com/commonmark/cmark) and [`cmark-gfm`](https://github.com/github/cmark-gfm#security),
231
229
Comrak will scrub raw HTML and potentially dangerous links. This change was introduced in Comrak 0.4.0 in support of a
232
-
safe-by-default posture.
230
+
safe-by-default posture, and later adopted by our contemporaries. :)
233
231
234
232
To allow these, use the `unsafe_` option (or `--unsafe` with the command line program). If doing so, we recommend the
235
233
use of a sanitisation library like [`ammonia`](https://github.com/notriddle/ammonia) configured specific to your needs.
@@ -252,29 +250,33 @@ Comrak additionally supports its own extensions, which are yet to be specced out
252
250
- Footnotes
253
251
- Description lists
254
252
- Front matter
255
-
-Shortcodes
253
+
-Multi-line blockquotes
256
254
- Math
257
-
- Multiline Blockquotes
255
+
- Emoji shortcodes
256
+
- Wikilinks
257
+
- Underline
258
+
- Spoiler text
259
+
- "Greentext"
258
260
259
261
By default none are enabled; they are individually enabled with each parse by setting the appropriate values in the
You'll need to [install hyperfine](https://github.com/sharkdp/hyperfine#installation), and CMake if you want to compare against `cmark-gfm`.
305
+
306
+
If you want to just run the benchmark for the `comrak` binary itself, run:
307
+
308
+
```bash
309
+
make bench-comrak
310
+
```
311
+
312
+
This will build Comrak in release mode, and run benchmark on it. You will see the time measurements as reported by hyperfine in the console.
313
+
314
+
The `Makefile` also provides a way to run benchmarks for `comrak` current state (with your changes), `comrak` main branch, [`cmark-gfm`](https://github.com/github/cmark-gfm), [`pulldown-cmark`](https://github.com/raphlinus/pulldown-cmark) and [`markdown-it.rs`](https://github.com/rlidwka/markdown-it.rs). You'll need CMake, and ensure [submodules are prepared](https://stackoverflow.com/a/10168693/499609).
315
+
316
+
```bash
317
+
make bench-all
318
+
```
319
+
320
+
This will build and run benchmarks across all, and report the time taken by each as well as relative time.
321
+
322
+
<!-- XXX: The following isn't really true at the moment, due to https://github.com/kivikakk/comrak/issues/339 -->
323
+
324
+
<!-- Apart from this, CI is also setup for running benchmarks when a pull request is first opened. It will add a comment with the results on the pull request in a tabular format comparing the 5 versions. After that you can manually trigger this CI by commenting `/run-bench` on the PR, this will update the existing comment with new results. Note benchmarks won't be automatically run on each push. -->
300
325
301
326
## Contributing
302
327
303
-
Contributions are highly encouraged; where possible I practice [Optimistic Merging](http://hintjens.com/blog:106) as
304
-
described by Peter Hintjens. Please keep the [code of conduct](CODE_OF_CONDUCT.md) in mind when interacting with this
305
-
project.
328
+
Contributions are **highly encouraged**; if you'd like to assist, consider checking out the [`good first issue` label](https://github.com/kivikakk/comrak/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)\! I'm happy to help provide direction and guidance throughout, even if (especially if\!) you're new to Rust or open source.
329
+
330
+
Where possible I practice [Optimistic Merging](http://hintjens.com/blog:106) as described by Peter Hintjens. Please keep the [code of conduct](CODE_OF_CONDUCT.md) in mind too.
306
331
307
332
Thank you to Comrak's many contributors for PRs and issues opened\!
0 commit comments