|
| 1 | +# micromark-rs |
| 2 | + |
| 3 | +Here be dragons! |
| 4 | +🐉 |
| 5 | +There’s a lot to do. |
| 6 | +Some major to dos are described here, more smaller ones are in the code. |
| 7 | + |
| 8 | +## Some useful scripts for now |
| 9 | + |
| 10 | +Run examples: |
| 11 | + |
| 12 | +```sh |
| 13 | +RUST_BACKTRACE=1 RUST_LOG=debug cargo run --example lib |
| 14 | +``` |
| 15 | + |
| 16 | +Format: |
| 17 | + |
| 18 | +```sh |
| 19 | +cargo fmt --all |
| 20 | +``` |
| 21 | + |
| 22 | +Lint: |
| 23 | + |
| 24 | +```sh |
| 25 | +cargo fmt --all -- --check && cargo clippy -- -W clippy::pedantic |
| 26 | +``` |
| 27 | + |
| 28 | +Tests: |
| 29 | + |
| 30 | +```sh |
| 31 | +RUST_BACKTRACE=1 cargo test |
| 32 | +``` |
| 33 | + |
| 34 | +Docs: |
| 35 | + |
| 36 | +```sh |
| 37 | +cargo doc --document-private-items |
| 38 | +``` |
| 39 | + |
| 40 | +(add `--open` to open them in a browser) |
| 41 | + |
| 42 | +## To do |
| 43 | + |
| 44 | +### Some major obstacles |
| 45 | + |
| 46 | +- [ ] (8) Subtokenization: figure out a good, fast way to deal with constructs in |
| 47 | + one content type that also are another content type |
| 48 | +- [ ] (1) Setext headings: can they be solved in content, or do they have to be |
| 49 | + solved in flow somehow |
| 50 | +- [ ] (8) Can content (and to a lesser extent string and text) operate more |
| 51 | + performantly than checking whether other flow constructs start a line, |
| 52 | + before exiting and actually attempting flow constructs? |
| 53 | +- [ ] (5) Figure out definitions and sharing those identifiers, and references |
| 54 | + before definitions |
| 55 | +- [ ] (3) Interrupting: sometimes flow can or cannot start depending on the |
| 56 | + previous construct (typically paragraph) |
| 57 | +- [ ] (5) Containers: this will be rather messy, and depends a lot on how |
| 58 | + subtokenization is solved |
| 59 | +- [ ] (3) Concrete constructs: HTML or code (fenced) cannot be “pierced” into by |
| 60 | + containers |
| 61 | +- [ ] (3) Lazy lines, in containers, in flow and content in a paragraph, a line |
| 62 | + does not need to be indented |
| 63 | +- [ ] (5) There’s a lot of rust-related choosing whether to pass (mutable) |
| 64 | + references or whatever around that should be refactored |
| 65 | +- [ ] (5) Figure out extensions |
| 66 | +- [ ] (1) Support turning off constructs |
| 67 | + |
| 68 | +### Small things |
| 69 | + |
| 70 | +- [ ] (3) Clean compiler |
| 71 | +- [ ] (1) Optionally remove dangerous protocols when compiling |
| 72 | +- [ ] (1) Use preferred line ending style in markdown |
| 73 | +- [ ] (1) Handle BOM at start |
| 74 | +- [ ] (1) Make sure tabs are handled properly and that positional info is perfect |
| 75 | +- [ ] (1) Make sure crlf/cr/lf are working perfectly |
| 76 | +- [ ] (3) Figure out lifetimes of things (see `life time` in source) |
| 77 | +- [ ] (3) Use `commonmark` tests |
| 78 | +- [ ] (3) Share a bunch of tests with `micromark-js` |
| 79 | +- [ ] (5) Do some research on rust best practices for APIs, e.g., what to accept, |
| 80 | + how to integrate with streams or so? |
| 81 | +- [ ] (1) Go through clippy rules, and such, to add strict code styles |
| 82 | +- [ ] (1) Make sure that rust character groups match CM character groups (e.g., is |
| 83 | + `unicode_whitespace` or so the same?) |
| 84 | +- [ ] (1) Any special handling of surrogates? |
| 85 | +- [ ] (1) Make sure debugging is useful for other folks |
| 86 | +- [ ] (3) Add some benchmarks, do some perf testing |
| 87 | +- [ ] (3) Write comparison to other parsers |
| 88 | +- [ ] (3) Add node/etc bindings? |
| 89 | +- [ ] (8) After all extensions, including MDX, are done, see if we can integrate |
| 90 | + this with SWC to compile MDX |
| 91 | +- [ ] (3) Bunch of docs |
| 92 | +- [ ] (5) Site |
| 93 | + |
| 94 | +### Constructs |
| 95 | + |
| 96 | +- [ ] (5) attention (strong, emphasis) (text) |
| 97 | +- [ ] (1) autolink |
| 98 | +- [x] blank line |
| 99 | +- [ ] (5) block quote |
| 100 | +- [x] character escape |
| 101 | +- [x] character reference |
| 102 | +- [x] code (fenced) |
| 103 | +- [x] code (indented) |
| 104 | +- [ ] (1) code (text) |
| 105 | +- [ ] (3) content |
| 106 | +- [ ] (3) definition |
| 107 | +- [ ] (1) hard break escape |
| 108 | +- [x] heading (atx) |
| 109 | +- [ ] (1) heading (setext) |
| 110 | +- [x] html (flow) |
| 111 | +- [ ] html (text) |
| 112 | +- [ ] (3) label end |
| 113 | +- [ ] (3) label start (image) |
| 114 | +- [ ] (3) label start (link) |
| 115 | +- [ ] (8) list |
| 116 | +- [ ] (1) paragraph |
| 117 | +- [x] thematic break |
| 118 | + |
| 119 | +### Content types |
| 120 | + |
| 121 | +- [ ] (8) container |
| 122 | + - [ ] block quote |
| 123 | + - [ ] list |
| 124 | +- [ ] (1) flow |
| 125 | + - [x] blank line |
| 126 | + - [x] code (fenced) |
| 127 | + - [x] code (indented) |
| 128 | + - [ ] content |
| 129 | + - [x] heading (atx) |
| 130 | + - [x] html (flow) |
| 131 | + - [x] thematic break |
| 132 | +- [ ] (3) content |
| 133 | + - [ ] definition |
| 134 | + - [ ] heading (setext) |
| 135 | + - [ ] paragraph |
| 136 | +- [ ] (5) text |
| 137 | + - [ ] attention (strong, emphasis) (text) |
| 138 | + - [ ] autolink |
| 139 | + - [x] character escape |
| 140 | + - [x] character reference |
| 141 | + - [ ] code (text) |
| 142 | + - [ ] hard break escape |
| 143 | + - [ ] html (text) |
| 144 | + - [ ] label end |
| 145 | + - [ ] label start (image) |
| 146 | + - [ ] label start (link) |
| 147 | +- [x] string |
| 148 | + - [x] character escape |
| 149 | + - [x] character reference |
| 150 | + |
| 151 | +### Extensions |
| 152 | + |
| 153 | +The main thing here is is to figure out if folks could extend from the outside |
| 154 | +with their own code, or if we need to maintain it all here. |
| 155 | +Regardless, it is essential for the launch of `micromark-rs` that extensions |
| 156 | +are theoretically or practically possible. |
| 157 | +The extensions below are listed from top to bottom from more important to less |
| 158 | +important. |
| 159 | + |
| 160 | +- [ ] (1) frontmatter (yaml, toml) (flow) |
| 161 | + — [`micromark-extension-frontmatter`](https://github.com/micromark/micromark-extension-frontmatter) |
| 162 | +- [ ] (3) autolink literal (GFM) (text) |
| 163 | + — [`micromark-extension-gfm-autolink-literal`](https://github.com/micromark/micromark-extension-gfm-autolink-literal) |
| 164 | +- [ ] (3) footnote (GFM) (content, text) |
| 165 | + — [`micromark-extension-gfm-footnote`](https://github.com/micromark/micromark-extension-gfm-footnote) |
| 166 | +- [ ] (3) strikethrough (GFM) (text) |
| 167 | + — [`micromark-extension-gfm-strikethrough`](https://github.com/micromark/micromark-extension-gfm-strikethrough) |
| 168 | +- [ ] (5) table (GFM) (flow) |
| 169 | + — [`micromark-extension-gfm-table`](https://github.com/micromark/micromark-extension-gfm-table) |
| 170 | +- [ ] (1) task list item (GFM) (text) |
| 171 | + — [`micromark-extension-gfm-task-list-item`](https://github.com/micromark/micromark-extension-gfm-task-list-item) |
| 172 | +- [ ] (3) math (flow, text) |
| 173 | + — [`micromark-extension-math`](https://github.com/micromark/micromark-extension-math) |
| 174 | +- [ ] (8) directive (flow, text) |
| 175 | + — [`micromark-extension-directive`](https://github.com/micromark/micromark-extension-directive) |
| 176 | +- [ ] (8) expression (MDX) (flow, text) |
| 177 | + — [`micromark-extension-mdx-expression`](https://github.com/micromark/micromark-extension-mdx-expression) |
| 178 | +- [ ] (5) JSX (MDX) (flow, text) |
| 179 | + — [`micromark-extension-mdx-jsx`](https://github.com/micromark/micromark-extension-mdx-jsx) |
| 180 | +- [ ] (3) ESM (MDX) (flow) |
| 181 | + — [`micromark-extension-mdxjs-esm`](https://github.com/micromark/micromark-extension-mdxjs-esm) |
| 182 | +- [ ] (1) tagfilter (GFM) (n/a, renderer) |
| 183 | + — [`micromark-extension-gfm-tagfilter`](https://github.com/micromark/micromark-extension-gfm-tagfilter) |
0 commit comments