3099 Commits

Author SHA1 Message Date
Eric Huss
3e5ec749ba Remove copy-fonts
This removes the deprecated `output.html.copy-fonts` option. This was
deprecated in https://github.com/rust-lang/mdBook/pull/1987. The
behavior now is that the default fonts are copied over unless there is a
custom `theme/fonts/fonts.css` file.
2025-08-12 17:56:14 -07:00
Eric Huss
7e0949175a Merge pull request #2789 from ehuss/remove-book-json
Remove book.json warning
2025-08-13 00:38:39 +00:00
Eric Huss
b51d3e5106 Merge pull request #2788 from ehuss/remove-curly-quotes
Remove curly-quotes
2025-08-13 00:36:33 +00:00
Eric Huss
f47066f68f Remove book.json warning
This warning was added in https://github.com/rust-lang/mdBook/pull/510
in 2017. I think plenty enough time has passed for projects to update.
2025-08-12 17:33:05 -07:00
Eric Huss
9ac0eb288a Remove curly-quotes
This removes the deprecated alias `curly-quotes` for
`smart-punctuation`.
2025-08-12 17:29:59 -07:00
Eric Huss
79e9ae48a1 Merge pull request #2787 from ehuss/deny-unknown-fields
Deny all unknown config fields
2025-08-12 22:20:20 +00:00
Eric Huss
d29072783f Deny all unknown config fields
This changes it so that it is an error if there is ever an unknown
configuration field. This is intended to help avoid things like typos,
or using an outdated version of mdbook. Although it is possible that new
fields could potentially safely be ignored, setting up a warning system
is a bit more of a hassle. I don't think mdbook needs to have the same
kind of multi-version support as something like cargo does. However, if
this ends up being too much of a pain point, we can try to add a warning
system instead.

There are a variety of changes here:

- The top-level config namespace is now closed so that it only accepts
  the keys defined in `Config`.
- All config tables now reject unknown fields.
- Added `Config::outputs` and `Config::preprocessors` for convenience
  to access the entire `output` and `preprocessor` tables.
- Moved the unit-tests that were setting environment variables to the
  testsuite where it launches a process instead.

Closes https://github.com/rust-lang/mdBook/issues/1595
2025-08-12 15:14:36 -07:00
Eric Huss
e284eb1c30 Merge pull request #2786 from ehuss/read_to_string-prelude
Add read_to_string to the prelude
2025-08-12 02:31:44 +00:00
Eric Huss
b09c588ca9 Merge pull request #2785 from ehuss/ensure-test-built
Don't rebuild books in tests
2025-08-12 02:27:02 +00:00
Eric Huss
a6a60eef31 Add read_to_string to the prelude
This adds the `read_to_string` test helper to the test prelude so that
it is easier to use.
2025-08-11 19:26:05 -07:00
Eric Huss
95128b6662 Merge pull request #2784 from ehuss/debug-testsuite
Add debug option to the testsuite
2025-08-12 02:21:35 +00:00
Eric Huss
824e2a7681 Don't rebuild books in tests
This fixes an issue where the `check` methods would inadvertently
rebuild the books if the `mdbook build` command is run. Normally this
isn't too much of an issue unless the `build` command is run with
options that affect the output.
2025-08-11 19:21:03 -07:00
Eric Huss
43e690dd13 Add debug option to the testsuite
This adds a basic debug method to the testsuite command to help with
diagnosing tests that aren't working as expected.
2025-08-11 19:15:53 -07:00
Eric Huss
4a2d3a7e85 Merge pull request #2783 from ehuss/no-legacy
Remove legacy config support
2025-08-11 15:31:07 +00:00
Eric Huss
eda77b81db Remove legacy config support
This removes the old legacy config that allowed certain things at the
top level.

The legacy switch was added in https://github.com/rust-lang/mdBook/pull/457

Closes https://github.com/rust-lang/mdBook/issues/2653
2025-08-11 08:25:04 -07:00
Eric Huss
8befcc74d1 Merge pull request #2779 from ehuss/non_exhaustive
Switch all public types to non_exhaustive
2025-08-10 00:07:29 +00:00
Eric Huss
5956092b4b Switch all public types to non_exhaustive
This switches all public types to use non_exhaustive to make it easier
to make additions without a semver-breaking change.

Some of the ergonomics are hampered due to the lack of exhaustiveness
checking. Hopefully some day in the future,
non_exhaustive_omitted_patterns_lint or something like it will get
stabilized.

Closes https://github.com/rust-lang/mdBook/issues/1835
2025-08-09 17:02:01 -07:00
Eric Huss
c25e866796 Make SectionNumber field private
This removes the `pub` status of the SectionNumber field. The intent is
to make this potentially extensible in the future if we decide to add
more fields, or change its internal representation. With the existence
of the deref impls, generally this change shouldn't be visible except
for the constructor, which hopefully shouldn't be too cumbersome to use
`SectionNumber::new` instead.
2025-08-09 17:02:01 -07:00
Eric Huss
1d1274e53a Merge pull request #2780 from ehuss/fix-nightly-panic-message
Fix test for nightly panic message change
2025-08-09 23:51:19 +00:00
Eric Huss
841c68d05e Fix test for nightly panic message change
A recent nightly changed the format of the panic message. This updates
the test that was matching against this so it doesn't match the text
that has changed.
2025-08-09 16:45:41 -07:00
Eric Huss
37273ba8e0 Merge pull request #2401 from Roms1383/chore/upgrade-pulldown-cmark
Upgrade pulldown cmark to 0.13.0
2025-07-26 15:39:13 +00:00
Roms1383
91f04bc7ba Upgrade pulldown-cmark to 0.13.0 2025-07-26 08:33:28 -07:00
Eric Huss
7cce45818a Merge pull request #2776 from ehuss/remove-google-analytics
Remove google-analytics
2025-07-26 15:22:19 +00:00
Eric Huss
84fbd679e7 Merge pull request #2775 from ehuss/remove-multilingual
Remove the book.multilingual field
2025-07-26 15:17:00 +00:00
Eric Huss
aef12bbb20 Remove google-analytics
This was deprecated in https://github.com/rust-lang/mdBook/pull/1675 in
2021.

Closes https://github.com/rust-lang/mdBook/issues/2720
2025-07-26 08:15:37 -07:00
Gabor Szabo
00eba964ce Remove the book.multilingual field
As it is seems it has never been in real use.

See #2636
2025-07-26 08:10:20 -07:00
Eric Huss
cf7762f57f Merge pull request #2774 from ehuss/update-toml
Update toml to 0.9.2
2025-07-25 20:30:08 +00:00
Eric Huss
26319f4124 Update toml to 0.9.2 2025-07-25 13:24:27 -07:00
Eric Huss
f8e66db41c Merge pull request #2773 from ehuss/remove-public-toml
Remove toml as a public dependency
2025-07-25 18:35:41 +00:00
Eric Huss
529cfc34ec Remove toml as a public dependency
This removes toml as a public dependency. This reduces the exposure of
the public API, reduces exposure of internal implementation, and makes
it easier to make semver-incompatible changes to toml.

This is accomplished through a variety of changes:

- `get` and `get_mut` are removed.
- `get_deserialized_opt` is renamed to `get`.
- Dropped the AsRef for `get_deserialized_opt` for ergonomics, since
  using an `&` for a String is not too much to ask, and the other
  generic arg needs to be specified in a fair number of situations.
- Removed deprecated `get_deserialized`.
- Dropped `TomlExt` from the public API.
- Removed `get_renderer` and `get_preprocessor` since they were trivial
  wrappers over `get`.
2025-07-25 11:29:07 -07:00
Eric Huss
8053774ba3 Fix Config.set working with the rust table 2025-07-25 11:29:07 -07:00
Eric Huss
fe76ee626f Merge pull request #2772 from ehuss/unreachable-pub
Enable unreachable_pub
2025-07-25 16:08:22 +00:00
Eric Huss
f6c062fc98 Enable unreachable_pub
This lint can help make it clearer which items are actually exposed in
the public API.
2025-07-25 09:02:55 -07:00
Eric Huss
97d9078a32 Merge pull request #2766 from ehuss/crate-split
Split mdbook into multiple crates
2025-07-24 00:54:10 +00:00
Eric Huss
a397f64356 Add a section on how to run tests 2025-07-23 17:47:31 -07:00
Eric Huss
fad53f720f Update guide to accommodate crate split
This updates the docs now that the crate has been split into multiple
crates.
2025-07-23 17:47:31 -07:00
Eric Huss
dcfb527342 Update crate docs
This updates the crate-level docs to add a little more detail for each
crate.

This also drops the `mdbook` library crate, as it is no longer needed.
2025-07-23 17:47:31 -07:00
Eric Huss
e0a4fb1ea9 Add READMEs for all new crates 2025-07-23 17:47:31 -07:00
Eric Huss
6e6518a7ae Move the remaining dependencies to the workspace table
This is intended to have all dependencies only defined in the workspace
table, and crates can then refer to it.
2025-07-23 17:47:31 -07:00
Eric Huss
12fc0ff5c3 Clean up dependencies of mdbook
These are no longer used, or are dev-dependencies only.
2025-07-23 17:47:31 -07:00
Eric Huss
b8a7b6e846 Simplify MDBook::iter doc
The original was a little awkward, and I'm not sure what the tuple
syntax was intending to convey.
2025-07-23 17:47:31 -07:00
Eric Huss
9229e80499 Clean up some remaining uses of mdbook_core
These should be using the appropriate high-level crate.
2025-07-23 17:47:31 -07:00
Eric Huss
ae6c4522bb Publicly re-export mdbook-core modules from mdbook-driver
The intent here is to make mdbook-core a private dependency that the
user shouldn't need.
2025-07-23 17:47:31 -07:00
Eric Huss
fdebbfdce2 Remove pulldown-cmark from mdbook-core
This dependency is no longer directly used.
2025-07-23 17:47:31 -07:00
Eric Huss
40745600a3 Finish move of MDBook to mdbook-driver 2025-07-23 17:47:31 -07:00
Eric Huss
5a31947eb7 Move MDBook to mdbook-driver
This is a pure git rename in order to make sure that git can follow
history. The next commit will integrate these into mdbook-driver.
2025-07-23 17:47:31 -07:00
Eric Huss
d758753551 Finish moving builtin renderers to mdbook-driver 2025-07-23 17:47:28 -07:00
Eric Huss
9b27b14985 Move built-in renderers to mdbook-driver
This is a pure git rename in order to make sure that git can follow
history. The next commit will integrate these into mdbook-driver.
2025-07-23 17:40:57 -07:00
Eric Huss
f5fc54461a Finish moving built-in preprocessors to mdbook-driver 2025-07-23 17:40:57 -07:00
Eric Huss
6aac696ee1 Move built-in preprocessors to mdbook-driver
This is a pure git rename in order to make sure that git can follow
history. The next commit will integrate these into mdbook-driver.
2025-07-23 17:40:57 -07:00