Skip to content

Commit 97d9078

Browse files
authored
Merge pull request #2766 from ehuss/crate-split
Split mdbook into multiple crates
2 parents 702c676 + a397f64 commit 97d9078

File tree

142 files changed

+2761
-2263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+2761
-2263
lines changed

.git-blame-ignore-revs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Use `git config blame.ignorerevsfile .git-blame-ignore-revs` to make `git blame` ignore the following commits.
2+
3+
# Rustfmt for 2024
4+
c7b67e363bb9ce3383636ee615e8e761bf185b33

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ jobs:
4040
- name: msrv
4141
os: ubuntu-22.04
4242
# sync MSRV with docs: guide/src/guide/installation.md and Cargo.toml
43-
rust: 1.82.0
43+
rust: 1.85.0
4444
target: x86_64-unknown-linux-gnu
4545
name: ${{ matrix.name }}
4646
steps:
4747
- uses: actions/checkout@v4
4848
- name: Install Rust
4949
run: bash ci/install-rust.sh ${{ matrix.rust }} ${{ matrix.target }}
5050
- name: Build and run tests
51-
run: cargo test --locked --target ${{ matrix.target }}
51+
run: cargo test --workspace --locked --target ${{ matrix.target }}
5252
- name: Test no default
53-
run: cargo test --no-default-features --target ${{ matrix.target }}
53+
run: cargo test --workspace --no-default-features --target ${{ matrix.target }}
5454

5555
aarch64-cross-builds:
5656
runs-on: ubuntu-22.04

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@ Please consider the following when making a change:
123123
124124
* Check out the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/) for guidelines on designing the API.
125125
126+
## Tests
127+
128+
The main test harness is described in the [testsuite documentation](tests/testsuite/README.md). There are several different commands to run different kinds of tests:
129+
130+
- `cargo test --workspace` — This runs all of the unit and integration tests, except for the GUI tests.
131+
- `cargo test --test gui` — This runs the [GUI test harness](#browser-compatibility-and-testing). This does not get run automatically due to its extra requirements.
132+
- `npm run lint` — [Checks the `.js` files](#checking-changes-in-js-files)
133+
- `cargo test --workspace --no-default-features` — Testing without default features helps check that all feature checks are implemented correctly.
134+
- `cargo clippy --workspace --all-targets --no-deps -- -D warnings` — This makes sure that there are no clippy warnings.
135+
- `RUSTDOCFLAGS="-D warnings" cargo doc --workspace --document-private-items --no-deps` — This verifies that there aren't any rustdoc warnings.
136+
- `cargo fmt --check` — Verifies that everything is formatted correctly.
137+
126138
## Making a pull-request
127139
128140
When you feel comfortable that your changes could be integrated into mdBook, you can create a pull-request on GitHub.

Cargo.lock

Lines changed: 107 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 95 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,130 @@
11
[workspace]
2-
members = [".", "examples/remove-emphasis/mdbook-remove-emphasis"]
2+
members = [
3+
".",
4+
"crates/*",
5+
"examples/remove-emphasis/mdbook-remove-emphasis",
6+
]
37

48
[workspace.lints.clippy]
59
all = { level = "allow", priority = -2 }
610
correctness = { level = "warn", priority = -1 }
711
complexity = { level = "warn", priority = -1 }
812

13+
[workspace.lints.rust]
14+
missing_docs = "warn"
15+
rust_2018_idioms = "warn"
16+
17+
[workspace.package]
18+
edition = "2024"
19+
license = "MPL-2.0"
20+
repository = "https://github.com/rust-lang/mdBook"
21+
rust-version = "1.85.0" # Keep in sync with installation.md and .github/workflows/main.yml
22+
23+
[workspace.dependencies]
24+
ammonia = "4.1.1"
25+
anyhow = "1.0.98"
26+
axum = "0.8.4"
27+
chrono = { version = "0.4.41", default-features = false, features = ["clock"] }
28+
clap = { version = "4.5.41", features = ["cargo", "wrap_help"] }
29+
clap_complete = "4.5.55"
30+
elasticlunr-rs = "3.0.2"
31+
env_logger = "0.11.8"
32+
futures-util = "0.3.31"
33+
handlebars = "6.3.2"
34+
hex = "0.4.3"
35+
ignore = "0.4.23"
36+
log = "0.4.27"
37+
mdbook-core = { path = "crates/mdbook-core" }
38+
mdbook-driver = { path = "crates/mdbook-driver" }
39+
mdbook-html = { path = "crates/mdbook-html" }
40+
mdbook-markdown = { path = "crates/mdbook-markdown" }
41+
mdbook-preprocessor = { path = "crates/mdbook-preprocessor" }
42+
mdbook-renderer = { path = "crates/mdbook-renderer" }
43+
mdbook-summary = { path = "crates/mdbook-summary" }
44+
memchr = "2.7.5"
45+
notify = "8.1.0"
46+
notify-debouncer-mini = "0.6.0"
47+
opener = "0.8.2"
48+
pathdiff = "0.2.3"
49+
pretty_assertions = "1.4.1"
50+
pulldown-cmark = { version = "0.10.3", default-features = false, features = ["html"] } # Do not update, part of the public api.
51+
regex = "1.11.1"
52+
select = "0.6.1"
53+
semver = "1.0.26"
54+
serde = { version = "1.0.219", features = ["derive"] }
55+
serde_json = "1.0.140"
56+
sha2 = "0.10.9"
57+
shlex = "1.3.0"
58+
snapbox = "0.6.21"
59+
tempfile = "3.20.0"
60+
tokio = "1.46.1"
61+
toml = "0.5.11" # Do not update, see https://github.com/rust-lang/mdBook/issues/2037
62+
topological-sort = "0.2.2"
63+
tower-http = "0.6.6"
64+
walkdir = "2.5.0"
65+
966
[package]
1067
name = "mdbook"
11-
version = "0.4.52"
68+
version = "0.5.0-alpha.1"
1269
authors = [
1370
"Mathieu David <[email protected]>",
1471
"Michael-F-Bryan <[email protected]>",
1572
"Matt Ickstadt <[email protected]>"
1673
]
1774
documentation = "https://rust-lang.github.io/mdBook/index.html"
18-
edition = "2021"
75+
edition.workspace = true
1976
exclude = ["/guide/*"]
2077
keywords = ["book", "gitbook", "rustbook", "markdown"]
21-
license = "MPL-2.0"
78+
license.workspace = true
2279
readme = "README.md"
23-
repository = "https://github.com/rust-lang/mdBook"
80+
repository.workspace = true
2481
description = "Creates a book from markdown files"
25-
rust-version = "1.82" # Keep in sync with installation.md and .github/workflows/main.yml
82+
rust-version.workspace = true
2683

2784
[dependencies]
28-
anyhow = "1.0.71"
29-
chrono = { version = "0.4.24", default-features = false, features = ["clock"] }
30-
clap = { version = "4.3.12", features = ["cargo", "wrap_help"] }
31-
clap_complete = "4.3.2"
32-
env_logger = "0.11.1"
33-
handlebars = "6.0"
34-
hex = "0.4.3"
35-
log = "0.4.17"
36-
memchr = "2.5.0"
37-
opener = "0.8.1"
38-
pulldown-cmark = { version = "0.10.0", default-features = false, features = ["html"] } # Do not update, part of the public api.
39-
regex = "1.8.1"
40-
serde = { version = "1.0.163", features = ["derive"] }
41-
serde_json = "1.0.96"
42-
sha2 = "0.10.8"
43-
shlex = "1.3.0"
44-
tempfile = "3.4.0"
45-
toml = "0.5.11" # Do not update, see https://github.com/rust-lang/mdBook/issues/2037
46-
topological-sort = "0.2.2"
85+
anyhow.workspace = true
86+
chrono.workspace = true
87+
clap.workspace = true
88+
clap_complete.workspace = true
89+
env_logger.workspace = true
90+
log.workspace = true
91+
mdbook-core.workspace = true
92+
mdbook-driver.workspace = true
93+
mdbook-html.workspace = true
94+
mdbook-markdown.workspace = true
95+
mdbook-preprocessor.workspace = true
96+
mdbook-renderer.workspace = true
97+
mdbook-summary.workspace = true
98+
opener.workspace = true
99+
toml.workspace = true
47100

48101
# Watch feature
49-
notify = { version = "8.0.0", optional = true }
50-
notify-debouncer-mini = { version = "0.6.0", optional = true }
51-
ignore = { version = "0.4.20", optional = true }
52-
pathdiff = { version = "0.2.1", optional = true }
53-
walkdir = { version = "2.3.3", optional = true }
102+
ignore = { workspace = true, optional = true }
103+
notify = { workspace = true, optional = true }
104+
notify-debouncer-mini = { workspace = true, optional = true }
105+
pathdiff = { workspace = true, optional = true }
106+
walkdir = { workspace = true, optional = true }
54107

55108
# Serve feature
56-
futures-util = { version = "0.3.28", optional = true }
57-
tokio = { version = "1.43.1", features = ["macros", "rt-multi-thread"], optional = true }
58-
axum = { version = "0.8.0", features = ["ws"], optional = true }
59-
tower-http = { version = "0.6.0", features = ["fs", "trace"], optional = true }
60-
61-
# Search feature
62-
elasticlunr-rs = { version = "3.0.2", optional = true }
63-
ammonia = { version = "4.0.0", optional = true }
109+
axum = { workspace = true, features = ["ws"], optional = true }
110+
futures-util = { workspace = true, optional = true }
111+
tokio = { workspace = true, features = ["macros", "rt-multi-thread"], optional = true }
112+
tower-http = { workspace = true, features = ["fs", "trace"], optional = true }
64113

65114
[dev-dependencies]
66-
select = "0.6.0"
67-
semver = "1.0.17"
68-
snapbox = { version = "0.6.21", features = ["diff", "dir", "term-svg", "regex", "json"] }
69-
pretty_assertions = "1.3.0"
70-
walkdir = "2.3.3"
115+
regex.workspace = true
116+
select.workspace = true
117+
semver.workspace = true
118+
serde_json.workspace = true
119+
snapbox = { workspace = true, features = ["diff", "dir", "term-svg", "regex", "json"] }
120+
tempfile.workspace = true
121+
walkdir.workspace = true
71122

72123
[features]
73124
default = ["watch", "serve", "search"]
74125
watch = ["dep:notify", "dep:notify-debouncer-mini", "dep:ignore", "dep:pathdiff", "dep:walkdir"]
75126
serve = ["dep:futures-util", "dep:tokio", "dep:axum", "dep:tower-http"]
76-
search = ["dep:elasticlunr-rs", "dep:ammonia"]
127+
search = ["mdbook-html/search"]
77128

78129
[[bin]]
79130
doc = false

0 commit comments

Comments
 (0)