No description
Find a file
Jesús Pérez 0784554c88 feat: site-url absolute links on mdBook 0.5.3 (crates layout)
Port of the 0.4.x site-url absolute-links patch to the 0.5 crates/ layout,
toward upstreaming as PR #1802. When output.html.site-url is set, internal
links and assets are emitted as absolute URLs anchored at site-url, so the
book works under a sub-path (e.g. /cdcidao/) regardless of page depth.

- html/tree.rs: fix_link/fix_html_link rewrite ./ content, image and raw-HTML
  links to {site_url}...; schemes and fragments untouched
- html_handlebars/hbs_renderer.rs: path_to_root = site_url for normal and index
  pages; base_url = site_url only for the toc.html iframe (removed before the
  per-chapter clone so it cannot leak)
- html_handlebars/helpers/resources.rs: {{resource}} honors an explicit
  path_to_root from data (absolute assets) with stock fallback
- html/print.rs: print page honors site-url; internal cross-refs still fold to
  #anchors, non-chapter links keep absolute form
- cmd/serve.rs: --preserve-site-url flag; serve still forces site-url to / for
  local preview but logs the override
- tests/testsuite/rendering*: site_url fixture + tests (content, assets, print,
  no <base> leak, no-regression without site-url)
- guide: document the serve flag and the renderer behavior
2026-06-18 23:03:22 +01:00
.cargo Add an xtask to help with running tests 2025-09-26 18:55:21 -07:00
.github Update cargo-semver-checks to v0.48.0 2026-06-08 09:08:54 -07:00
ci Add job to automatically update dependencies 2025-09-24 16:05:14 -07:00
crates feat: site-url absolute links on mdBook 0.5.3 (crates layout) 2026-06-18 23:03:22 +01:00
examples chore(deps): update rust crate pulldown-cmark-to-cmark to v22 2026-01-01 00:38:01 +00:00
guide feat: site-url absolute links on mdBook 0.5.3 (crates layout) 2026-06-18 23:03:22 +01:00
src feat: site-url absolute links on mdBook 0.5.3 (crates layout) 2026-06-18 23:03:22 +01:00
tests feat: site-url absolute links on mdBook 0.5.3 (crates layout) 2026-06-18 23:03:22 +01:00
.git-blame-ignore-revs Add more rustfmt commits to git blame ignore 2025-10-20 13:31:03 -07:00
.gitattributes Mark more font files as binary 2025-04-05 20:41:36 -04:00
.gitignore Support multiple books in the GUI tests 2025-10-15 07:00:33 -07:00
Cargo.lock Update cargo dependencies 2026-06-08 12:19:34 -07:00
Cargo.toml Update cargo dependencies 2026-06-08 12:19:34 -07:00
CHANGELOG.md Bump to 0.5.3 2026-05-19 15:45:59 -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 to 0.5.1 2025-11-19 17:36:49 -08:00
eslint.config.mjs Lint HBS JS templates 2025-08-25 15:15:47 -07:00
LICENSE Create LICENSE 2015-07-29 01:11:30 +02:00
package.json Update browser-ui-test version to 0.24.0 2026-06-08 15:38:02 +02:00
README.md README.md: update workflow status badge 2025-02-13 11:01:08 -05:00
rustfmt.toml Add rustfmt.toml 2025-07-23 17:29:55 -07:00
triagebot.toml Add triagebot range-diff feature 2025-09-24 17:00:52 -07:00

mdBook

CI 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.