Commit graph

397 commits

Author SHA1 Message Date
Eric Huss
9ec0628222 Bump to 0.5.3 2026-05-19 15:45:59 -07:00
github-actions[bot]
d2f954cb51 Update cargo dependencies
```
name          old req compatible latest new req
====          ======= ========== ====== =======
clap_complete 4.6.2   4.6.3      4.6.3  4.6.3
```
2026-05-01 00:59:54 +00:00
github-actions[bot]
1cf231e42f Update cargo dependencies
```
name               old req compatible latest new req
====               ======= ========== ====== =======
axum               0.8.8   0.8.9      0.8.9  0.8.9
clap               4.5.60  4.6.1      4.6.1  4.6.1
clap_complete      4.5.66  4.6.2      4.6.2  4.6.2
indexmap           2.13.0  2.14.0     2.14.0 2.14.0
pulldown-cmark     0.13.1  0.13.3     0.13.3 0.13.3
semver             1.0.27  1.0.28     1.0.28 1.0.28
snapbox            1.0.0   1.2.1      1.2.1  1.2.1
tempfile           3.26.0  3.27.0     3.27.0 3.27.0
tokio              1.49.0  1.52.1     1.52.1 1.52.1
toml               1.0.3   1.1.2      1.1.2  1.1.2
tracing-subscriber 0.3.22  0.3.23     0.3.23 0.3.23
```
2026-04-23 16:51:51 +00:00
renovate[bot]
4c0aa34d1e chore(deps): update rust crate sha2 to 0.11.0 2026-04-23 08:53:06 -07:00
renovate[bot]
a4db4a833d chore(deps): update rust crate html5ever to 0.39.0 2026-04-20 19:26:02 -07:00
Eric Huss
05badb1e2d Update cargo dependencies
```
name           old req compatible latest  new req
====           ======= ========== ======  =======
anyhow         1.0.100 1.0.102    1.0.102 1.0.102
clap           4.5.56  4.5.60     4.5.60  4.5.60
clap_complete  4.5.65  4.5.66     4.5.66  4.5.66
futures-util   0.3.31  0.3.32     0.3.32  0.3.32
memchr         2.7.6   2.8.0      2.8.0   2.8.0
pulldown-cmark 0.13.0  0.13.1     0.13.1  0.13.1
regex          1.12.2  1.12.3     1.12.3  1.12.3
tempfile       3.24.0  3.26.0     3.26.0  3.26.0
toml           1.0.0   1.0.3      1.0.3   1.0.3
```
2026-03-01 14:46:03 -08:00
Eric Huss
31e5c1e6d5
Merge pull request #3045 from rust-lang/renovate/toml-1.x
chore(deps): update rust crate toml to v1
2026-03-01 22:13:27 +00:00
renovate[bot]
f0d9591bb9
chore(deps): update rust crate toml to v1 2026-03-01 00:46:18 +00:00
renovate[bot]
1b61b0b941
chore(deps): update rust crate snapbox to v1 2026-03-01 00:46:11 +00:00
Eric Huss
b2e952dd4c Remove unused dependencies
These dependencies of the top-level `mdbook` package are not directly
used. They are used transitively, so this makes little difference, but
helps to convey what is actually needed.
2026-02-23 07:20:41 -08:00
Eric Huss
ec2b103e78
Merge pull request #3017 from rust-lang/renovate/ego-tree-0.x
chore(deps): update rust crate ego-tree to 0.11.0
2026-02-01 03:00:13 +00:00
renovate[bot]
c5fc1542ee
chore(deps): update rust crate html5ever to 0.38.0 2026-02-01 02:23:00 +00:00
renovate[bot]
13c560f478
chore(deps): update rust crate ego-tree to 0.11.0 2026-02-01 02:22:56 +00:00
github-actions[bot]
f2eb07292a Update cargo dependencies
```
name          old req compatible latest  new req
====          ======= ========== ======  =======
clap          4.5.53  4.5.56     4.5.56  4.5.56
clap_complete 4.5.64  4.5.65     4.5.65  4.5.65
handlebars    6.3.2   6.4.0      6.4.0   6.4.0
indexmap      2.12.1  2.13.0     2.13.0  2.13.0
opener        0.8.3   0.8.4      0.8.4   0.8.4
serde_json    1.0.148 1.0.149    1.0.149 1.0.149
snapbox       0.6.23  0.6.24     0.6.24  0.6.24
tokio         1.48.0  1.49.0     1.49.0  1.49.0
toml          0.9.10  0.9.11     0.9.11  0.9.11
```
2026-02-01 00:45:42 +00:00
github-actions[bot]
1d08190aca Update cargo dependencies
```
name          old req compatible latest  new req
====          ======= ========== ======  =======
axum          0.8.7   0.8.8      0.8.8   0.8.8
clap_complete 4.5.61  4.5.64     4.5.64  4.5.64
html5ever     0.36.0  0.36.1     0.36.1  0.36.1
serde_json    1.0.145 1.0.148    1.0.148 1.0.148
tempfile      3.23.0  3.24.0     3.24.0  3.24.0
toml          0.9.8   0.9.10     0.9.10  0.9.10
tower-http    0.6.7   0.6.8      0.6.8   0.6.8
tracing       0.1.43  0.1.44     0.1.44  0.1.44
name                    old req compatible latest new req note
====                    ======= ========== ====== ======= ====
pulldown-cmark-to-cmark 21.0.0  21.1.0     22.0.0 21.1.0  incompatible
```
2026-01-01 00:36:42 +00:00
Eric Huss
94569a42da Update to 0.5.2 2025-12-11 11:40:27 -08:00
renovate[bot]
3d39bf4adb
Update Rust crate html5ever to 0.36.0 2025-12-01 18:31:50 +00:00
github-actions[bot]
8bd3c52abf Update cargo dependencies
```
name               old req compatible latest new req
====               ======= ========== ====== =======
axum               0.8.6   0.8.7      0.8.7  0.8.7
clap               4.5.51  4.5.53     4.5.53 4.5.53
clap_complete      4.5.60  4.5.61     4.5.61 4.5.61
indexmap           2.12.0  2.12.1     2.12.1 2.12.1
tower-http         0.6.6   0.6.7      0.6.7  0.6.7
tracing            0.1.41  0.1.43     0.1.43 0.1.43
tracing-subscriber 0.3.20  0.3.22     0.3.22 0.3.22
name                    old req compatible latest new req
====                    ======= ========== ====== =======
pulldown-cmark-to-cmark 21.0.0  21.1.0     21.1.0 21.1.0
```
2025-12-01 00:37:48 +00:00
Eric Huss
eb83d080f6 Update to 0.5.1 2025-11-19 17:36:49 -08:00
Eric Huss
262afdc2f8 Update to 0.5.0
This is the stable release of 0.5.0. No changes have been made since
0.5.0-beta.2.
2025-11-17 08:57:52 -08:00
Eric Huss
922f0d8ad4 Update to 0.5.0-beta.2.
I expect this to be the last pre-release before 0.5.
2025-11-07 18:00:52 -08:00
github-actions[bot]
7619f9a91c Update cargo dependencies
```
name          old req compatible latest new req
====          ======= ========== ====== =======
clap          4.5.50  4.5.51     4.5.51 4.5.51
clap_complete 4.5.59  4.5.60     4.5.60 4.5.60
ignore        0.4.24  0.4.25     0.4.25 0.4.25
snapbox       0.6.22  0.6.23     0.6.23 0.6.23
```
2025-11-01 00:32:23 +00:00
Eric Huss
ac11e00aa2 Update to 0.5.0-beta.1 2025-10-26 12:55:06 -07:00
github-actions[bot]
7945ac8e8c Update cargo dependencies
```
name          old req compatible latest  new req
====          ======= ========== ======  =======
anyhow        1.0.98  1.0.100    1.0.100 1.0.100
axum          0.8.4   0.8.6      0.8.6   0.8.6
clap          4.5.41  4.5.50     4.5.50  4.5.50
clap_complete 4.5.55  4.5.59     4.5.59  4.5.59
indexmap      2.10.0  2.12.0     2.12.0  2.12.0
ignore        0.4.23  0.4.24     0.4.24  0.4.24
memchr        2.7.5   2.7.6      2.7.6   2.7.6
notify        8.1.0   8.2.0      8.2.0   8.2.0
opener        0.8.2   0.8.3      0.8.3   0.8.3
regex         1.11.1  1.12.2     1.12.2  1.12.2
semver        1.0.26  1.0.27     1.0.27  1.0.27
serde         1.0.219 1.0.228    1.0.228 1.0.228
serde_json    1.0.140 1.0.145    1.0.145 1.0.145
snapbox       0.6.21  0.6.22     0.6.22  0.6.22
tempfile      3.20.0  3.23.0     3.23.0  3.23.0
tokio         1.46.1  1.48.0     1.48.0  1.48.0
toml          0.9.2   0.9.8      0.9.8   0.9.8
```
2025-10-21 01:16:53 +00:00
renovate[bot]
c438e13027 Update Rust crate notify-debouncer-mini to 0.7.0 2025-09-28 10:00:01 -07:00
Eric Huss
4fc72e8d9f Set up new workspace publish workflow
This sets up the publish workflow to use the new OIDC authentication,
and to publish the whole workspace at once.
2025-09-26 17:40:34 -07:00
Eric Huss
2b242494b0 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:26:35 -07:00
Eric Huss
d15a40123c Remove chrono
I accidentally missed this in https://github.com/rust-lang/mdBook/pull/2829.
2025-09-15 06:50:50 -07:00
Eric Huss
3e673ce424 Switch from log to tracing
This switches to using the tracing crate instead of log. Tracing
provides a lot of nice features which we can take advantage of moving
forward.

This also adjusts the output fairly significantly. This includes:

- Switched the environment variable from RUST_LOG to MDBOOK_LOG.
- Dropped the timestamp. I experimented with various different time
  displays, but ultimately decided to omit it for now. I don't think
  I've ever found it to be useful, and it takes up a very significant
  amount of space. It could potentially be useful for basic profiling,
  but I think there are other, better mechanisms for that. We could
  consider leveraging tracing itself for doing some basic profiling
  (like using something like tracing-chrome).
- Dropped the target unless MDBOOK_LOG is set. The target tends to be
  pretty noisy, and doesn't really convey much information unless you
  are debugging or otherwise trying to adjust the log output.
- Added color.
- Slightly reworked the way the error cause trace is displayed.
- Slightly changed the way html5ever filtering is done, as well as add
  handlebars to the list since they both are very noisy. You can
  override this now by explicitly listing them as targets.

I still expect that mdbook will eventually change how it displays things
to the console, possibly switching away from tracing and printing things
itself. However, that is a larger project for the future.
2025-09-12 06:13:45 -07:00
Eric Huss
29b71be0a5 Add the mdbook version to the first page of the guide
This displays the version of mdBook that the guide is for.
2025-09-03 15:06:33 -07:00
Eric Huss
d071d127ef Add globs to test path names
This adds the ability for some test functions to use a glob pattern to
match a single file. This will be helpful when testing hash-files
support.
2025-08-26 15:44:01 -07:00
Eric Huss
338a9b424e Change with_renderer/with_preprocessor to overwrite
This changes `with_renderer` and `with_preprocessor` to replace any
extensions of the same name instead of just appending to the list. This
is necessary for rust-lang's build process, because we replace the
preprocessors with local ones. Previously, mdbook would just print an
error, but continue working. With the change that preprocessors are no
longer optional by default, it is now required that we have a way to
replace the existing entries.
2025-08-18 11:18:31 -07:00
Michael Howell
2dc8c5e686 Use embedded SVG instead of fonts for icons
The [downsides of icon fonts] are well-documented, and also, why ship all of
the icons when it only uses 14?

[downsides of icon fonts]: https://speakerdeck.com/ninjanails/death-to-icon-fonts
2025-08-14 20:14:55 -07: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
Roms1383
91f04bc7ba Upgrade pulldown-cmark to 0.13.0 2025-07-26 08:33:28 -07:00
Eric Huss
26319f4124 Update toml to 0.9.2 2025-07-25 13:24:27 -07: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
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
40745600a3 Finish move of MDBook to mdbook-driver 2025-07-23 17:47:31 -07:00
Eric Huss
f5fc54461a Finish moving built-in preprocessors to mdbook-driver 2025-07-23 17:40:57 -07:00
Eric Huss
c8571f592c Add mdbook-driver
This is intended to hold the high-level MDBook type.
2025-07-23 17:40:57 -07:00
Eric Huss
7eccd1d556 Finish move of hbs_renderer to mdbook-html
This updates everything for the move of hbs_renderer to mdbook-html.
2025-07-23 17:40:57 -07:00
Eric Huss
753780f653 Finish move of theme to mdbook-html
This updates everything for the move of theme to mdbook-html. There
will be followup commits that will be doing more cleanup here.
2025-07-23 17:40:57 -07:00
Eric Huss
6805740e20 Add mdbook-html
This new crate will hold the HTML renderer and related front-end parts.
2025-07-23 17:29:55 -07:00
Eric Huss
8f3b6b4776 Move markdown support to mdbook-markdown
This moves all the code responsible for markdown processing to the
mdbook-markdown crate.
2025-07-23 17:29:55 -07:00
Eric Huss
3278f84373 Move renderer types to mdbook-renderer
This sets up mdbook-renderer with the intent of being the core
library that renderers use to implement the necessary interactions.
2025-07-23 17:29:55 -07:00
Eric Huss
12285f505d Move preprocessor types to mdbook-preprocessor
This sets up mdbook-preprocessor with the intent of being the core
library that preprocessors use to implement the necessary interactions.
2025-07-23 17:29:55 -07:00
Eric Huss
7bcdfe6f0f Finish move of summary to mdbook-summary
This updates everything for the move of summary to mdbook-summary. There
will be followup commits that will be doing more cleanup here.
2025-07-23 17:29:55 -07:00
Eric Huss
bd3e555962 Add mdbook-summary
This new crate will hold the Summary types and parsing support.
2025-07-23 17:29:55 -07:00