Create book from markdown files. Like Gitbook but implemented in Rust
Go to file
Michael Howell 14250259ef Scope splitting syntect "boring" implementation
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">&quot;</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">&quot;</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.
2022-08-15 14:03:09 -07:00
.github/workflows chore: Upgrade MSRV 2022-03-28 13:06:44 -05:00
ci Update deprecated GitHub Actions commands. 2020-10-08 10:00:06 -07:00
examples refactor: Move from deprecated SubCommand 2022-03-28 13:06:50 -05:00
guide Use syntect instead of highlight.js 2022-08-15 14:03:09 -07:00
src Scope splitting syntect "boring" implementation 2022-08-15 14:03:09 -07:00
test_book Add rust specific codeblock examples 2021-10-05 12:11:29 +05:30
tests Scope splitting syntect "boring" implementation 2022-08-15 14:03:09 -07:00
.gitattributes Explicitly mark fonts and images files as binary (#951) 2019-06-11 21:44:15 +02:00
.gitignore Setup basic structure for test book 2021-10-04 13:14:49 +05:30
CHANGELOG.md Update to 0.4.21 2022-07-22 10:54:53 -07:00
CODE_OF_CONDUCT.md add explicit code of conduct, copying other rust-lang repos 2021-07-26 11:52:24 -07:00
CONTRIBUTING.md Update documentation 2021-12-19 20:26:37 -08:00
Cargo.lock Use syntect instead of highlight.js 2022-08-15 14:03:09 -07:00
Cargo.toml Remove profiling release profile 2022-08-15 14:03:09 -07:00
LICENSE Create LICENSE 2015-07-29 01:11:30 +02:00
README.md Update documentation 2021-12-19 20:26:37 -08:00
release.toml Metadata for cargo-release should be in release.toml (#722) 2018-07-09 18:36:55 +08:00
triagebot.toml Add minimal traigebot config 2021-10-27 19:31:08 +05:30

README.md

mdBook

Build Status crates.io LICENSE

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.