14250259ef
This PR attempts to get a syntect implementation that actually works, by manipulating the scope stack directly instead of trying to post-process the HTML. It takes strings like this: let _t = "interesting string \# boring string "; And produces DOMs that look like this: <span class="syn-source syn-rust"> <span class="syn-storage syn-type syn-rust">let</span> _t <span class="syn-keyword syn-operator syn-assignment syn-rust">=</span> <span class="syn-string syn-quoted syn-double syn-rust"> <span class="syn-punctuation syn-definition syn-string syn-begin syn-rust">"</span> interesting string </span> </span> <span class="boring"> <span class="syn-source syn-rust"> <span class="syn-string syn-quoted syn-double syn-rust">boring string</span> </span> </span> <span class="syn-source syn-rust"> <span class="syn-string syn-quoted syn-double syn-rust"> <span class="syn-punctuation syn-definition syn-string syn-end syn-rust">"</span> </span> <span class="syn-punctuation syn-terminator syn-rust">;</span> </span> In other words, it splits it up the same way a WYSIWYG editor might if you tried to apply a block style to a deeply-nested selection; it maintains the styles, but always ensures "boring" is top-level. It doesn't produce optimal HTML, but it should always work. |
||
---|---|---|
.github/workflows | ||
ci | ||
examples | ||
guide | ||
src | ||
test_book | ||
tests | ||
.gitattributes | ||
.gitignore | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE | ||
README.md | ||
release.toml | ||
triagebot.toml |
README.md
mdBook
mdBook is a utility to create modern online books from Markdown files.
Check out the User Guide for a list of features and installation and usage information. The User Guide also serves as a demonstration to showcase what a book looks like.
If you are interested in contributing to the development of mdBook, check out the Contribution Guide.
License
All the code in this repository is released under the Mozilla Public License v2.0, for more information take a look at the LICENSE file.