mdbook/crates/mdbook-html
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
..
front-end Improve spacing in sidebar section headings 2026-05-19 15:19:35 -07:00
src feat: site-url absolute links on mdBook 0.5.3 (crates layout) 2026-06-18 23:03:22 +01:00
Cargo.toml Bump to 0.5.3 2026-05-19 15:45:59 -07:00
README.md Add READMEs for all new crates 2025-07-23 17:47:31 -07:00

mdbook-html

Documentation crates.io Changelog

This is the HTML renderer for mdBook. This is intended for internal use only. It is automatically included by mdbook-driver to render books to HTML.

This crate is maintained by the mdBook team, primarily for use by mdBook and not intended for external use (except as a transitive dependency). This crate may make major changes to its APIs or be deprecated without warning.

License

Mozilla Public License, version 2.0