mdbook/Cargo.toml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

158 lines
4.5 KiB
TOML
Raw Normal View History

2024-11-02 15:41:55 -07:00
[workspace]
members = [
".",
"crates/*",
"examples/remove-emphasis/mdbook-remove-emphasis", "guide/guide-helper",
]
2024-11-02 15:41:55 -07:00
[workspace.lints.clippy]
all = { level = "allow", priority = -2 }
correctness = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
exhaustive_enums = "warn"
exhaustive_structs = "warn"
manual_non_exhaustive = "warn"
[workspace.lints.rust]
missing_docs = "warn"
rust_2018_idioms = "warn"
unreachable_pub = "warn"
[workspace.package]
2025-07-21 10:30:43 -07:00
edition = "2024"
license = "MPL-2.0"
repository = "https://github.com/rust-lang/mdBook"
Add a new HTML rendering pipeline This rewrites the HTML rendering pipeline to use a tree data structure, and implements a custom HTML serializer. The intent is to make it easier to make changes and to manipulate the output. This should make some future changes much easier. This is a large change, but I'll try to briefly summarize what's changing: - All of the HTML rendering support has been moved out of mdbook-markdown into mdbook-html. For now, all of the API surface is private, though we may consider ways to safely expose it in the future. - Instead of using pulldown-cmark's html serializer, this takes the pulldown-cmark events and translates them into a tree data structure (using the ego-tree crate to define the tree). See `tree.rs`. - HTML in the markdown document is parsed using html5ever, and then lives inside the same tree data structure. See `tokenizer.rs`. - Transformations are then applied to the tree data structure. For example, adding header links or hiding code lines. - Serialization is a simple process of writing out the nodes to a string. See `serialize.rs`. - The search indexer works on the tree structure instead of re-rendering every chapter twice. See `html_handlebars/search.rs`. - The print page now takes a very different approach of taking the same tree structure built for rendering the chapters, and applies transformations to it. This avoid re-parsing everything again. See `print.rs`. - I changed the linking behavior so that links on the print page link to items on the print page instead of outside the print page. - There are a variety of small changes to how it serializes as can be seen in the changes to the tests. Some highlights: - Code blocks no longer have a second layer of `<pre>` tags wrapping it. - Fixed a minor issue where a rust code block with a specific edition was having the wrong classes when there was a default edition. - Drops the ammonia dependency, which significantly reduces the number of dependencies. It was only being used for a very minor task, and we can handle it much more easily now. - Drops `pretty_assertions`, they are no longer used (mostly being migrated to the testsuite). There's obviously a lot of risk trying to parse everything to such a low level, but I think the benefits are worth it. Also, the API isn't super ergonomic compared to say javascript (there are no selectors), but it works well enough so far. I have not run this through rigorous benchmarking, but it does have a very noticeable performance improvement, especially in a debug build. I expect in the future that we'll want to expose some kind of integration with extensions so they have access to this tree structure (or some kind of tree structure). Closes https://github.com/rust-lang/mdBook/issues/1736
2025-09-16 20:14:00 -07:00
rust-version = "1.88.0" # Keep in sync with installation.md and .github/workflows/main.yml
[workspace.dependencies]
anyhow = "1.0.98"
axum = "0.8.4"
clap = { version = "4.5.41", features = ["cargo", "wrap_help"] }
clap_complete = "4.5.55"
Add a new HTML rendering pipeline This rewrites the HTML rendering pipeline to use a tree data structure, and implements a custom HTML serializer. The intent is to make it easier to make changes and to manipulate the output. This should make some future changes much easier. This is a large change, but I'll try to briefly summarize what's changing: - All of the HTML rendering support has been moved out of mdbook-markdown into mdbook-html. For now, all of the API surface is private, though we may consider ways to safely expose it in the future. - Instead of using pulldown-cmark's html serializer, this takes the pulldown-cmark events and translates them into a tree data structure (using the ego-tree crate to define the tree). See `tree.rs`. - HTML in the markdown document is parsed using html5ever, and then lives inside the same tree data structure. See `tokenizer.rs`. - Transformations are then applied to the tree data structure. For example, adding header links or hiding code lines. - Serialization is a simple process of writing out the nodes to a string. See `serialize.rs`. - The search indexer works on the tree structure instead of re-rendering every chapter twice. See `html_handlebars/search.rs`. - The print page now takes a very different approach of taking the same tree structure built for rendering the chapters, and applies transformations to it. This avoid re-parsing everything again. See `print.rs`. - I changed the linking behavior so that links on the print page link to items on the print page instead of outside the print page. - There are a variety of small changes to how it serializes as can be seen in the changes to the tests. Some highlights: - Code blocks no longer have a second layer of `<pre>` tags wrapping it. - Fixed a minor issue where a rust code block with a specific edition was having the wrong classes when there was a default edition. - Drops the ammonia dependency, which significantly reduces the number of dependencies. It was only being used for a very minor task, and we can handle it much more easily now. - Drops `pretty_assertions`, they are no longer used (mostly being migrated to the testsuite). There's obviously a lot of risk trying to parse everything to such a low level, but I think the benefits are worth it. Also, the API isn't super ergonomic compared to say javascript (there are no selectors), but it works well enough so far. I have not run this through rigorous benchmarking, but it does have a very noticeable performance improvement, especially in a debug build. I expect in the future that we'll want to expose some kind of integration with extensions so they have access to this tree structure (or some kind of tree structure). Closes https://github.com/rust-lang/mdBook/issues/1736
2025-09-16 20:14:00 -07:00
ego-tree = "0.10.0"
elasticlunr-rs = "3.0.2"
font-awesome-as-a-crate = "0.3.0"
futures-util = "0.3.31"
glob = "0.3.3"
handlebars = "6.3.2"
hex = "0.4.3"
Add a new HTML rendering pipeline This rewrites the HTML rendering pipeline to use a tree data structure, and implements a custom HTML serializer. The intent is to make it easier to make changes and to manipulate the output. This should make some future changes much easier. This is a large change, but I'll try to briefly summarize what's changing: - All of the HTML rendering support has been moved out of mdbook-markdown into mdbook-html. For now, all of the API surface is private, though we may consider ways to safely expose it in the future. - Instead of using pulldown-cmark's html serializer, this takes the pulldown-cmark events and translates them into a tree data structure (using the ego-tree crate to define the tree). See `tree.rs`. - HTML in the markdown document is parsed using html5ever, and then lives inside the same tree data structure. See `tokenizer.rs`. - Transformations are then applied to the tree data structure. For example, adding header links or hiding code lines. - Serialization is a simple process of writing out the nodes to a string. See `serialize.rs`. - The search indexer works on the tree structure instead of re-rendering every chapter twice. See `html_handlebars/search.rs`. - The print page now takes a very different approach of taking the same tree structure built for rendering the chapters, and applies transformations to it. This avoid re-parsing everything again. See `print.rs`. - I changed the linking behavior so that links on the print page link to items on the print page instead of outside the print page. - There are a variety of small changes to how it serializes as can be seen in the changes to the tests. Some highlights: - Code blocks no longer have a second layer of `<pre>` tags wrapping it. - Fixed a minor issue where a rust code block with a specific edition was having the wrong classes when there was a default edition. - Drops the ammonia dependency, which significantly reduces the number of dependencies. It was only being used for a very minor task, and we can handle it much more easily now. - Drops `pretty_assertions`, they are no longer used (mostly being migrated to the testsuite). There's obviously a lot of risk trying to parse everything to such a low level, but I think the benefits are worth it. Also, the API isn't super ergonomic compared to say javascript (there are no selectors), but it works well enough so far. I have not run this through rigorous benchmarking, but it does have a very noticeable performance improvement, especially in a debug build. I expect in the future that we'll want to expose some kind of integration with extensions so they have access to this tree structure (or some kind of tree structure). Closes https://github.com/rust-lang/mdBook/issues/1736
2025-09-16 20:14:00 -07:00
html5ever = "0.35.0"
indexmap = "2.10.0"
ignore = "0.4.23"
mdbook-core = { path = "crates/mdbook-core", version = "0.5.0-alpha.1" }
mdbook-driver = { path = "crates/mdbook-driver", version = "0.5.0-alpha.1" }
mdbook-html = { path = "crates/mdbook-html", version = "0.5.0-alpha.1" }
mdbook-markdown = { path = "crates/mdbook-markdown", version = "0.5.0-alpha.1" }
mdbook-preprocessor = { path = "crates/mdbook-preprocessor", version = "0.5.0-alpha.1" }
mdbook-renderer = { path = "crates/mdbook-renderer", version = "0.5.0-alpha.1" }
mdbook-summary = { path = "crates/mdbook-summary", version = "0.5.0-alpha.1" }
memchr = "2.7.5"
notify = "8.1.0"
notify-debouncer-mini = "0.6.0"
opener = "0.8.2"
pathdiff = "0.2.3"
2024-06-16 10:16:10 +07:00
pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] } # Do not update, part of the public api.
regex = "1.11.1"
select = "0.6.1"
semver = "1.0.26"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
sha2 = "0.10.9"
shlex = "1.3.0"
snapbox = "0.6.21"
tempfile = "3.20.0"
tokio = "1.46.1"
2025-07-25 13:24:19 -07:00
toml = "0.9.2"
2025-07-21 21:42:58 -07:00
topological-sort = "0.2.2"
tower-http = "0.6.6"
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
walkdir = "2.5.0"
2015-07-06 14:21:59 +02:00
[package]
name = "mdbook"
version = "0.5.0-alpha.1"
authors = [
2018-12-25 21:10:45 +09:00
"Mathieu David <mathieudavid@mathieudavid.org>",
"Michael-F-Bryan <michaelfbryan@gmail.com>",
"Matt Ickstadt <mattico8@gmail.com>"
]
documentation = "https://rust-lang.github.io/mdBook/index.html"
edition.workspace = true
exclude = ["/guide/*"]
2015-08-06 23:37:44 +02:00
keywords = ["book", "gitbook", "rustbook", "markdown"]
license.workspace = true
2015-08-06 23:37:44 +02:00
readme = "README.md"
repository.workspace = true
description = "Creates a book from markdown files"
rust-version.workspace = true
2015-07-06 21:12:24 +02:00
[dependencies]
anyhow.workspace = true
clap.workspace = true
clap_complete.workspace = true
mdbook-core.workspace = true
mdbook-driver.workspace = true
mdbook-html.workspace = true
mdbook-markdown.workspace = true
mdbook-preprocessor.workspace = true
mdbook-renderer.workspace = true
mdbook-summary.workspace = true
opener.workspace = true
toml.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
# Watch feature
ignore = { workspace = true, optional = true }
notify = { workspace = true, optional = true }
notify-debouncer-mini = { workspace = true, optional = true }
pathdiff = { workspace = true, optional = true }
walkdir = { workspace = true, optional = true }
2016-04-02 04:46:05 +02:00
# Serve feature
axum = { workspace = true, features = ["ws"], optional = true }
futures-util = { workspace = true, optional = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"], optional = true }
tower-http = { workspace = true, features = ["fs", "trace"], optional = true }
2016-04-02 04:46:05 +02:00
[dev-dependencies]
glob.workspace = true
regex.workspace = true
select.workspace = true
semver.workspace = true
serde_json.workspace = true
snapbox = { workspace = true, features = ["diff", "dir", "term-svg", "regex", "json"] }
tempfile.workspace = true
walkdir.workspace = true
[features]
default = ["watch", "serve", "search"]
2024-02-24 13:35:39 -08:00
watch = ["dep:notify", "dep:notify-debouncer-mini", "dep:ignore", "dep:pathdiff", "dep:walkdir"]
serve = ["dep:futures-util", "dep:tokio", "dep:axum", "dep:tower-http"]
search = ["mdbook-html/search"]
2015-08-06 12:38:48 +02:00
[[bin]]
doc = false
name = "mdbook"
[[example]]
name = "nop-preprocessor"
test = true
2024-11-02 15:41:55 -07:00
[[example]]
name = "remove-emphasis"
path = "examples/remove-emphasis/test.rs"
crate-type = ["lib"]
test = true
2024-11-08 15:15:45 +01:00
[[test]]
harness = false
test = false
name = "gui"
path = "tests/gui/runner.rs"
crate-type = ["bin"]
[lints]
workspace = true