80 KiB
Changelog
mdBook 0.5.1
Changed
- Changed the scrollbar background to be transparent. #2932
- Ignore invalid top-level environment variable config keys. This allows setting things like
MDBOOK_VERSIONto not cause an error. #2952
Fixed
- Fixed the sidebar heading nav to have the correct nesting levels. #2953
- Various Font Awesome fixes and improvements. #2951
mdBook 0.5.0
The 0.5.0 release is the next major release of mdBook, containing over 130 PRs since 0.4.52! The primary focus for this release has been an evolution of the Rust APIs to make it easier to maintain, to evolve in a backwards-compatible fashion, to clean up some things that have accumulated over time, and to significantly improve the performance and compile-times.
This release also includes many new features described below.
We have prepared a 0.5 Migration Guide to help existing authors switch from 0.4.
The final 0.5.0 release only contains the following changes since 0.5.0-beta.2:
- Added error handling to environment config handling. This checks that environment variables starting with
MDBOOK_are correctly specified instead of silently ignoring. This also fixed being able to replace entire top-level tables likeMDBOOK_OUTPUT. #2942
0.5 Migration Guide
The 0.5 release contains several breaking changes from the 0.4 release. Preprocessors and renderers will need to be migrated to continue to work with this release. After updating your configuration, it is recommended to carefully compare and review how your book renders to ensure everything is working correctly.
If you have overridden any of the theme files, you will likely need to update them to match the current version.
See the entries below for mdBook 0.5.0-alpha.1, mdBook 0.5.0-beta.1, and mdBook 0.5.0-beta.2 for a more complete list of changes and fixes.
The following is a summary of the changes that may require your attention when updating to 0.5:
Major additions
- Added sidebar heading navigation. This includes the
output.html.sidebar-header-navoption to disable it. #2822 - Added support for definition lists. These are enabled by default, with the option
output.html.definition-liststo disable it. See docs for more. #2847 - Added support for admonitions. These are enabled by default, with the option
output.html.admonitionsto disable it. See docs for more. #2851 - Links on the print page now link to elements on the print page instead of linking out to the individual chapters. #2844
Config changes
- Unknown fields in config are now an error. #2787 #2801
- Removed
curly-quotes, useoutput.html.smart-punctuationinstead. #2788 - Removed
output.html.copy-fonts. The default fonts are now always copied unless you override thetheme/fonts/fonts.cssfile. #2790 - If the
commandpath for a renderer or preprocessor is relative, it is now always relative to the book root. #2792 #2796 - Added the
optionalfield for preprocessors. The default isfalse, so this also means it is an error by default if the preprocessor is missing. #2797 output.html.smart-punctuationis nowtrueby default. #2810output.html.hash-filesis nowtrueby default. #2820- Removed support for google-analytics. Use a theme extension (like
head.hbs) if you need to continue to support this. #2776 - Removed the
book.multilingualfield. This was never used. #2775 - Removed the very old legacy config support. Warnings have been displayed in previous versions on how to migrate. #2783
- Top-level config values set from the environment like
MDBOOK_BOOKnow replace the contents of the top-level table instead of merging into it. #2942 - Invalid environment variables are now rejected. Previously unknown keys like
MDBOOK_FOOwould be ignored, or keys or invalid values inside objects like the[book]table would be ignored. #2942
Theme changes
- Replaced the
{{#previous}}and{{#next}}handlebars helpers with simple objects that contain the previous and next values. #2794 - Removed the
{{theme_option}}handlebars helper. It has not been used for a while. #2795
Rendering changes
- Updated to a newer version of
pulldown-cmark. This brings a large number of fixes to markdown processing. #2401 - The font-awesome font is no longer loaded as a font. Instead, the corresponding SVG is embedded in the output for the corresponding
<i>tags. Additionally, a handlebars helper has been added for thehbsfiles. This also updates the version from 4.7.0 to 6.2.0, which means some of the icon names and styles have changed. Most of the free icons are in the "solid" set. See the free icon set for the available icons. #1330 - Changed all internal HTML IDs to have an
mdbook-prefix. This helps avoid namespace conflicts with header IDs. #2808 - There is a new internal HTML rendering pipeline. This is primarily intended to give mdBook more flexibility in generating its HTML output. This resulted in some small changes to the HTML structure. HTML parsing may now be more strict than before. #2844
- Links on the print page now link to elements on the print page instead of linking out to the individual chapters. #2844
- Added support for definition lists. These are enabled by default, with the option
output.html.definition-liststo disable it. #2847 - Added support for admonitions. These are enabled by default, with the option
output.html.admonitionsto disable it. #2851 - Header ID generation has some minor changes to bring the ID generation closer to other tools and sites:
- Headers are no longer modified if the tag is manually written HTML. #2913
CLI changes
- Removed the
--dest-diroption tomdbook test. It was unused sincemdbook testdoes not generate output. #2805 - Changed CLI
--dest-dirto be relative to the current directory, not the book root. #2806
Rust API
- The Rust API has been split into several crates (#2766). In summary, the different crates are:
mdbook— The CLI binary.mdbook-driver— The high-level library for running mdBook, primarily through theMDBooktype. If you are driving mdBook programmatically, this is the crate you want.mdbook-preprocessor— Support for implementing preprocessors. If you have a preprocessor, then this is the crate you should depend on.mdbook-renderer— Support for implementing renderers. If you have a custom renderer, this is the crate you should depend on.mdbook-markdown— The Markdown renderer. If you are processing markdown, this is the crate you should depend on. This is essentially a thin wrapper aroundpulldown-cmark, and re-exports that crate so that you can ensure the version stays in sync with mdBook.mdbook-summary— TheSUMMARY.mdparser.mdbook-html— The HTML renderer.mdbook-core— An internal library that is used by the other crates for shared types. You should not depend on this crate directly since types from this crate are re-exported from the other crates as appropriate.
- Changes to
Config:Config::getis now generic over the return value, usingserdeto deserialize the value. It also returns aResultto handle deserialization errors. #2773Config::setnow validates that the config keys and values are valid. #2942Config::update_from_envnow returns aResultto indicate any errors. #2942- Removed
Config::get_deserialized. UseConfig::getinstead. - Removed
Config::get_deserialized_opt. UseConfig::getinstead. - Removed
Config::get_mut. UseConfig::setinstead. - Removed deprecated
Config::get_deserialized_opt. UseConfig::getinstead. - Removed
Config::get_renderer. UseConfig::getinstead. - Removed
Config::get_preprocessor. UseConfig::getinstead.
- Public types have been switch to use the
#[non_exhaustive]attribute to help allow them to change in a backwards-compatible way. #2779 #2823 - Changed
MDBookwith_renderer/with_preprocessorto overwrite the entry if an extension of the same name is already loaded. This allows the caller to replace an entry. #2802 - Added
MarkdownOptionsstruct to specify settings for markdown rendering formdbook_markdown::new_cmark_parser. #2809 - Renamed
Book::sectionstoBook::items. #2813 mdbook::book::load_bookis now private. Instead, use one of theMDBookload functions likeMDBook::load_with_config.- Removed
HtmlConfig::smart_punctuationmethod, use the field of the same name. CmdPreprocessor::parse_inputmoved tomdbook_preprocessor::parse_input.Preprocessor::supports_renderernow returns aResult<bool>instead ofboolto be able to handle errors.- Most of the types from the
thememodule are now private. TheThemestruct is still exposed for working with themes. - Various functions in the
utils::fsmodule have been removed, renamed, or reworked. - Most of the functions in the
utilsmodule have been moved, removed, or made private.
mdBook 0.5.0-beta.2
Added
- Added a warning when a Font Awesome icon is missing. #2915
- Added some trace logging for event processing. #2911
- Added
Config::contains_key. #2910
Changed
- Heading IDs are now lowercase. #2922
- Updated cargo dependencies. #2916
- Removed italics for in quotes/comments in code blocks with the
ayutheme. #2904 - Exposed "search" feature from mdbook-driver. #2907
Fixed
- Fixed rust fenced code blocks with an indent. #2905
- Headers and
dttags are no longer modified if the tag is manually written HTML. #2913 - Fixed print page links for internal links to non-chapters. #2914
- Better handling for unbalanced HTML tags. #2924
- Handle unclosed HTML tags inside a markdown element. #2927
- Fixed missing font-awesome icons in the guide. #2926
- Hide the sidebar resize indicator when JS isn't available. #2923
mdBook 0.5.0-beta.1
v0.5.0-alpha.1...v0.5.0-beta.1
Changed
- Reworked the look of the header navigation. #2898
- Update cargo dependencies. #2896
- Improved the heading nav debug. #2892
Fixed
- Fixed error message for config.get deserialization error. #2902
- Filter
<mark>tags from sidebar heading nav. #2899 - Avoid divide-by-zero in heading nav computation #2891
- Fixed heading nav with folded chapters. #2893
mdBook 0.5.0-alpha.1
Added
- The location of the generated HTML book is now displayed on the console. #2729
- ❗ Added the
optionalfield for preprocessors. The default isfalse, so this also changes it so that it is an error if the preprocessor is missing. #2797 - ❗ Added
MarkdownOptionsstruct to specify settings for markdown rendering. #2809 - Added sidebar heading navigation. This includes the
output.html.sidebar-header-navoption to disable it. #2822 - Added the mdbook version to the guide. #2826
- Added
Book::chaptersandBook::for_each_chapter_mutto more conveniently iterate over chapters (instead of all items). #2838 - ❗ Added support for definition lists. These are enabled by default, with the option
output.html.definition-liststo disable it. #2847 - ❗ Added support for admonitions. These are enabled by default, with the option
output.html.admonitionsto disable it. #2851
Changed
- ❗ The
mdbookcrate has been split into multiple crates. #2766 - The minimum Rust version has been updated to 1.88. #2844
- ❗
pulldown-cmarkhas been upgraded to 0.13.0, bringing a large number of fixes to markdown processing. #2401 - ❗ Switched public types to
non_exhaustiveto help allow them to change in a backwards-compatible way. #2779 #2823 - ❗ Unknown fields in config are now an error. #2787 #2801
- ❗ Changed
id_from_contentto be private. #2791 - ❗ Changed preprocessor
commandto use paths relative to the book root. #2796 - ❗ Replaced the
{{#previous}}and{{#next}}handelbars navigation helpers with objects. #2794 - ❗ Use embedded SVG instead of fonts for icons, font-awesome 6.2. #1330
- The
book.srcfield is no longer serialized if it is the default of "src". #2800 - ❗ Changed
MDBookwith_renderer/with_preprocessorto overwrite the entry if an extension of the same name is already loaded. #2802 - ❗ Changed CLI
--dest-dirto be relative to the current directory, not the book root. #2806 - ❗ Changed all internal HTML IDs to have an
mdbook-prefix. This helps avoid namespace conflicts with header IDs. #2808 - ❗
output.html.smart-punctuationis nowtrueby default. #2810 - ❗ Renamed
Book::sectionstoBook::items. #2813 - ❗
output.html.hash-filesis nowtrueby default. #2820 - Switched from
logtotracing. #2829 - ❗ Rewrote the HTML rendering pipeline. #2844
- ❗ Links on the print page now link to elements on the print page instead of linking out to the individual chapters. #2844
- ❗ Moved theme copy to the Theme type and reduced visibility. #2857
- ❗ Cleaned up some fs-related utilities. #2856
- ❗ Moved
get_404_output_filetoHtmlConfig. #2855 - ❗ Moved
take_linesfunctions tomdbook-driverand made private. #2854 - Updated dependencies. #2793 #2869
Removed
- ❗ Removed
tomlas a public dependency. #2773 - ❗ Removed the
book.multilingualfield. This was never used. #2775 - ❗ Removed support for google-analytics. #2776
- ❗ Removed the very old legacy config support. #2783
- ❗ Removed
curly-quotes, useoutput.html.smart-punctuationinstead. #2788 - Removed old warning about
book.json. #2789 - ❗ Removed
output.html.copy-fonts. The default fonts are now always copied unless you override thetheme/fonts/fonts.cssfile. #2790 - ❗ Removed legacy relative renderer command paths. Relative renderer command paths now must always be relative to the book root. #2792
- ❗ Removed the
{{theme_option}}handlebars helper. It has not been used for a while. #2795 - ❗ Removed the
--dest-diroption tomdbook test. #2805
Fixed
- Fixed handling of multiple footnotes in a row. #2807
- Fixed ID collisions when the numeric suffix gets used. #2846
- Fixed missing css vars for no-js dark mode. #2850
mdBook 0.4.52
Note: If you have a custom index.hbs theme file, it is recommended that you update it to the latest version to pick up the fixes in this release.
Added
- Added the ability to redirect
#HTML fragments using the existingoutput.html.redirecttable. #2747 - Added the
rel="edit"attribute to the edit page button. #2702
Changed
- The search index is now only loaded when the search input is opened instead of always being loaded. #2553 #2735
- The
mdbook servecommand has switched its underlying server library from warp to axum. #2748 - Updated dependencies. #2752
Fixed
- The sidebar is now set to
display:nonewhen it is hidden in order to prevent the browser's search from thinking the sidebar's text is visible. #2725 - Fixed search index URL not updating correctly when
hash-filesis enabled. #2742 #2746 - Fixed several sidebar animation bugs, particularly when manually resizing. #2750
mdBook 0.4.51
Fixed
- Fixed regression that broke the
Ssearch hotkey. #2713
mdBook 0.4.50
Added
- Added a keyboard shortcut help popup when pressing
?. #2608
Changed
- Changed the look of the sidebar resize handle to match the new rustdoc format. #2691
/can now be used to open the search bar. #2698- Pressing enter from the search bar will navigate to the first entry. #2698
- Updated
openerto drop some dependencies. #2709 - Updated dependencies, MSRV raised to 1.82. #2711
Fixed
- Fixed uncaught exception when pressing down when there are no search results. #2698
- Fixed syntax highlighting of Rust code in the ACE editor. #2710
mdBook 0.4.49
Added
- Added a warning on unused fields in the root of
book.toml. #2622
Changed
- Updated dependencies. #2650 #2688
- Updated minimum Rust version to 1.81. #2688
- The unused
book.multilingualfield is no longer serialized, or shown inmdbook init. #2689 - Speed up search index loading by using
JSON.parseinstead of parsing JavaScript. #2633
Fixed
- Search highlighting will not try to highlight in SVG
<text>elements because it breaks the element. #2668 - Fixed scrolling of the sidebar when a search highlight term is in the URL. #2675
- Fixed issues when multiple footnote definitions use the same ID. Now, only one definition is used, and a warning is displayed. #2681
- The sidebar is now restricted to 80% of the viewport width to make it possible to collapse it when the viewport is very narrow. #2679
mdBook 0.4.48
Added
- Footnotes now have back-reference links. These links bring the reader back to the original location. As part of this change, footnotes are now only rendered at the bottom of the page. This also includes some styling updates and fixes for footnote rendering. #2626
- Added an "Auto" theme selection option which will default to the system-preferred mode. This will also automatically switch when the system changes the preferred mode. #2576
Changed
- The
searchindex.jsonfile has been removed; only thesearchindex.jsfile will be generated. #2552 - Updated Javascript code to use eslint. #2554
- An error is generated if there are duplicate files in
SUMMARY.md. #2613
mdBook 0.4.47
Fixed
- Fixed search not showing up in sub-directories. #2586
mdBook 0.4.46
Changed
- The
output.html.hash-filesconfig option has been added to add hashes to static filenames to bust any caches when a book is updated.{{resource}}template tags have been added so that links can be properly generated to those files. #1368
Fixed
- Playground links for Rust 2024 now set the edition correctly. #2557
mdBook 0.4.45
Changed
- Added context to error message when rustdoc is not found. #2545
- Slightly changed the styling rules around margins of footnotes. #2524
Fixed
- Fixed an issue where it would panic if a source_path is not set. #2550
mdBook 0.4.44
Added
- Added pre-built aarch64-apple-darwin binaries to the releases. #2500
mdbook cleannow shows a summary of what it did. #2458- Added the
output.html.search.chapterconfig setting to disable search indexing of individual chapters. #2533
Fixed
- Fixed auto-scrolling the side-bar when loading a page with a
#fragment URL. #2517 - Fixed display of sidebar when javascript is disabled. #2529
- Fixed the sidebar visibility getting out of sync with the button. #2532
Changed
- ❗ Rust code block hidden lines now follow the same logic as rustdoc. This requires a space after the
#symbol. #2530 - ❗ Updated the Linux pre-built binaries which requires a newer version of glibc (2.34). #2523
- Updated dependencies #2538 #2539
mdBook 0.4.43
Fixed
- Fixed setting the title in
mdbook initwhen no git user is configured. #2486
Changed
- The Rust 2024 edition no longer needs
-Zunstable-options. #2495
mdBook 0.4.42
Fixed
- Fixed chapter list folding. #2473
mdBook 0.4.41
Note: If you have a custom index.hbs theme file, you will need to update it to the latest version.
Added
- Added preliminary support for Rust 2024 edition. #2398
- Added a full example of the remove-emphasis preprocessor. #2464
Changed
- Adjusted styling of clipboard/play icons. #2421
- Updated to handlebars v6. #2416
- Attr and section rules now have specific code highlighting. #2448
- The sidebar is now loaded from a common file, significantly reducing the book size when there are many chapters. #2414
- Updated dependencies. #2470
Fixed
- Improved theme support when JavaScript is disabled. #2454
- Fixed broken themes when localStorage has an invalid theme id. #2463
- Adjusted the line-height of superscripts (and footnotes) to avoid adding extra space between lines. #2465
mdBook 0.4.40
Fixed
- Reverted the update to pulldown-cmark which broke the semver API. #2388
mdBook 0.4.39
Fixed
- Fixed the automatic deploy broken in the previous release. #2383
mdBook 0.4.38
Added
- Added
nixto the default set of languages supported for syntax highlighting. #2262
Changed
- The
output.html.curly-quotesoption has been renamed tooutput.html.smart-punctuationto better reflect what it does. The old optioncurly-quotesis kept for compatibility, but may be removed in the future. #2327 - The file-watcher used in
mdbook serveandmdbook watchnow uses a poll-based watcher instead of the native operating system notifications. This should fix issues on various systems and environments, and more accurately detect when files change. The native watcher can still be used with the--watcher nativeCLI option. #2325 mdbook testoutput now includes color, and shows relative paths to the source. #2259- Updated dependencies, MSRV raised to 1.74 #2350 #2351 #2378 #2381
Fixed
- Reduced memory allocation when copying files. #2355
- Fixed the horizontal divider in
SUMMARY.mdfrom being indented into the previous nested section. #2364 - Removed unnecessary
@importin the CSS. #2260
mdBook 0.4.37
Changed
- ❗️ Updated the markdown parser. This brings in many changes to more closely follow the CommonMark spec. This may cause some small rendering changes. It is recommended to compare the output of the old and new version to check for changes. See https://github.com/raphlinus/pulldown-cmark/releases/tag/v0.10.0 for more information. #2308
- The warning about the legacy
src/themedirectory has been removed. #2263 - Updated dependencies. MSRV raised to 1.71.0. #2283 #2293 #2297 #2310 #2309
- Some internal performance/memory improvements. #2273 #2290
- Made the
pathdiffdependency optional based on thewatchfeature. #2291
Fixed
- The
sshortcut key handler should not trigger when focus is in an HTML form. #2311
mdBook 0.4.36
Added
- Added Nim to the default highlighted languages. #2232
- Added a small indicator for the sidebar resize handle. #2209
Changed
Fixed
- Fixed blank column in print page when the sidebar was visible. #2235
- Fixed indentation of code blocks when Javascript is disabled. #2162
- Fixed a panic when
mdbook serveormdbook watchwere given certain kinds of paths. #2229
mdBook 0.4.35
Added
- Added the
book.text-directionsetting for explicit support for right-to-left languages. #1641 - Added
rel=prefetchto the "next" links to potentially improve browser performance. #2168 - Added a
.warningCSS class which is styled for displaying warning blocks. #2187
Changed
- Better support of the sidebar when JavaScript is disabled. #2175
mdBook 0.4.34
Fixed
- Fixed file change watcher failing on macOS with a large number of files. #2157
mdBook 0.4.33
Added
- The
color-schemeCSS property is now set based on the light/dark theme, which applies some slight color differences in browser elements like scroll bars on some browsers. #2134
Fixed
- Fixed watching of extra-watch-dirs when not running in the book root directory. #2146
- Reverted the dependency update to the
tomlcrate (again!). This was an unintentional breaking change in 0.4.32. #2021 - Changed macOS change notifications to use the kqueue implementation which should fix some issues with repeated rebuilds when a file changed. #2152
- Don't set a background color in the print page for code blocks in a header. #2150
mdBook 0.4.32
Fixed
- Fixed theme-color meta tag not syncing with the theme. #2118
Changed
mdBook 0.4.31
Fixed
- Fixed menu border render flash during page navigation. #2101
- Fixed flicker setting sidebar scroll position. #2104
- Fixed compile error with proc-macro2 on latest Rust nightly. #2109
mdBook 0.4.30
Added
- Added support for heading attributes.
Attributes are specified in curly braces just after the heading text.
An HTML ID can be specified with
#and classes with.. For example:## My heading {#custom-id .class1 .class2}#2013 - Added support for hidden code lines for languages other than Rust.
The
output.html.code.hidelinestable allows you to define the prefix character that will be used to hide code lines based on the language. #2093
Fixed
- Fixed a few minor markdown rendering issues. #2092
mdBook 0.4.29
Changed
- Built-in fonts are no longer copied when
fonts/fonts.cssis overridden in the theme directory. Additionally, the warning aboutcopy-fontshas been removed iffonts/fonts.cssis specified. #2080 mdbook init --forcenow skips all interactive prompts as intended. #2057- Updated dependencies #2063 #2086 #2082 #2084 #2085
Fixed
- Switched from the
gitignorelibrary toignore. This should bring some improvements with gitignore handling. #2076
mdBook 0.4.28
Changed
- The sidebar is now shown on wide screens when localstorage is disabled. #2017
- Preprocessors are now run with
mdbook test. #1986
Fixed
- Fixed regression in 0.4.26 that prevented the title bar from scrolling properly on smaller screens. #2039
mdBook 0.4.27
Changed
- Reverted the dependency update to the
tomlcrate. This was an unintentional breaking change in 0.4.26. #2021
mdBook 0.4.26
The 0.4.26 release has been yanked due to an unintentional breaking change.
Changed
- Removed custom scrollbars for webkit browsers #1961
- Updated some dependencies #1998 #2009 #2011
- Fonts are now part of the theme.
The
output.html.copy-fontsoption has been deprecated. To define custom fonts, be sure to definetheme/fonts.css. #1987
Fixed
- Fixed overflow viewport issue with mobile Safari #1994
mdBook 0.4.25
Fixed
- Fixed a regression where
mdbook test -L deps path-to-bookwould not work. #1959
mdBook 0.4.24
Fixed
- The precompiled linux-gnu mdbook binary available on GitHub Releases inadvertently switched to a newer version of glibc. This release goes back to an older version that should be more compatible on older versions of Linux. #1955
mdBook 0.4.23
Changed
Fixed
- Fixed a regression where playground code was missing hidden lines, preventing it from compiling correctly. #1950
mdBook 0.4.22
Added
- Added a
--chapteroption tomdbook testto specify a specific chapter to test. #1741 - Added CSS styling for
<kbd>tags. #1906 - Added pre-compiled binaries for
x86_64-unknown-linux-muslandaarch64-unknown-linux-musl(see Releases). #1862 - Added
build.extra-watch-dirswhich is an array of additional directories to watch for changes when runningmdbook serve. #1884
Changed
- Removed the
type="text/javascript"attribute from<script>tags. #1881 - Switched to building with Rust Edition 2021. This raises the minimum supported Rust version to 1.56. #1887
- When hidden code is hidden, the hidden parts are no longer copied to the clipboard via the copy button. #1911
- Various HTML changes and fixes to be more compliant with HTML5. #1924
- The theme picker now shows which theme is currently selected. #1935
Fixed
- Avoid blank line at the end of an ACE code block #1836
mdBook 0.4.21
Fixed
- Fixed an issue where mdBook would fail to compile with Rust nightly-2022-07-22. #1861
mdBook 0.4.20
Fixed
- Fixed a regression in 0.4.19 where inline code would have excessive padding in some situations such as headings. #1855
mdBook 0.4.19
Added
- The
servecommand now supports HEAD requests. #1825
Changed
- An error is now generated when a custom theme directory does not exist. #1791
- Very wide tables now have independent horizontal scrolling so that scrolling to see the rest of the table will not scroll the entire page. #1617
- The buttons on code blocks are now only shown when the mouse cursor hovers over them (or tapped on mobile). There is also some extra spacing to reduce the overlap with the code. #1806
- The first chapter always generates an
index.htmlfile. Previously it would only generate the index file for prefix chapters. #1829
Fixed
mdbook serve --opennow properly handles the case if the first chapter is a draft. #1714 #1830- Very long words (over 80 characters) are no longer indexed to avoid a stack overflow. #1833
mdBook 0.4.18
Fixed
- Fixed rendering of SUMMARY links that contain markdown escapes or other markdown elements. #1785
mdBook 0.4.17
Fixed
- Fixed parsing of
output.html.printconfiguration table. #1775
mdBook 0.4.16
Added
- Added
output.html.print.page-breakconfig option to control whether or not there is a page break between chapters in the print output. #1728 - Added
output.html.playground.runnableconfig option to globally disable the run button in code blocks. #1546
Changed
- The
mdbook servelive reload websocket now uses the protocol, host, and port of the current page, allowing access through a proxy. #1771 - The 404 not-found page now includes the books title in the HTML title tag. #1693
- Migrated to clap 3.0 which handles CLI option parsing. #1731
Fixed
- Minor fixes to the markdown parser. #1729
- Fixed incorrect parsing in
SUMMARY.mdwhen it didn't start with a title. #1744 - Fixed duplicate anchor IDs for links in search results. #1749
mdBook 0.4.15
Changed
- Major update to expand the documentation located at https://rust-lang.github.io/mdBook/. #1709 #1710
- Updated the markdown parser with various fixes for common-mark compliance. #1712
mdBook 0.4.14
Added
- The 2021 Rust edition option has been stabilized. #1642
Changed
- Header anchors no longer include any HTML tags. Previously only a small subset were excluded. #1683
- Deprecated the google-analytics option. Books using this option should place
the appropriate code in the
theme/head.hbsfile instead. #1675
Fixed
- Updated the markdown parser which brings in a few small fixes and removes the custom smart quote handling. #1668
- Fixed iOS Safari enlarging text when going into landscape mode. #1685
mdBook 0.4.13
Added
- Added the ability to specify the preprocessor order. #1607
Fixed
- Include chapters with no headers in the search index #1637
- Switched to the
openercrate for opening a web browser, which should fix some issues with blocking. #1656 - Fixed clicking the border of the theme switcher breaking the theme selection. #1651
mdBook 0.4.12
Changed
- Reverted the change to update to highlight.js 11, as it broke hidden code lines. #1597
mdBook 0.4.11
Added
- Added support for Rust 2021 edition. #1596
- Added
mdbook completionssubcommand which provides shell completions. #1425 - Added
--titleand--ignoreflags tomdbook initto avoid the interactive input. #1559
Changed
- If running a Rust example does not have any output, it now displays the text "No output" instead of not showing anything. #1599
- Code block language tags can now be separated by space or tab (along with commas) to match the behavior of other sites like GitHub and rustdoc. #1469
- Updated
warp(the web server) to the latest version. This also updates the minimum supported Rust version to 1.46. #1612 - Updated to highlight.js 11. This has various highlighting improvements. #1597
Fixed
- Inline code blocks inside a header are no longer highlighted when
output.html.playground.editableistrue. #1613
mdBook 0.4.10
Changed
- Reverted breaking change in 0.4.9 that removed the
__non_exhaustivemarker on theBookstruct. #1572 - Updated handlebars to 4.0. #1550
- Removed the
chapter_beginid on the print page's chapter separators. #1541
mdBook 0.4.9
Changed
- Updated all dependencies and raised the minimum Rust version to 1.42. #1528
- Added more detail to error message when a preprocessor fails. #1526
- Set max-width of HTML video tags to 100% to match img tags. #1542
Fixed
- Type errors when parsing
book.tomlare no longer ignored. #1539 - Better handling if
mdbook servefails to start the http server. #1555 - Fixed the path for
edit-url-templateif the book used a source directory other thansrc. #1554
mdBook 0.4.8
Added
- Added the option
output.html.edit-url-templatewhich can be a URL which is linked on each page to direct the user to a site (such as GitHub) where the user can directly suggest an edit for the page they are currently reading. #1506
Changed
- Printed output now includes a page break between chapters. #1485
Fixed
- HTML, such as HTML comments, is now ignored if it appears above the title line
in
SUMMARY.md. #1437
mdBook 0.4.7
Changed
- Updated shlex parser to fix a minor parsing issue (used by the preprocessor/backend custom command config). #1471
- Enhanced text contrast of
lighttheme to improve accessibility. #1470
Fixed
- Fixed some issues with fragment scrolling and linking. #1463
mdBook 0.4.6
Changed
- The chapter name is now included in the search breadcrumbs. #1389
- Pressing Escape will remove the
?highlightargument from the URL. #1427 mdbook init --themewill now place the theme in the root of the book directory instead of in thesrcdirectory. #1432- A custom renderer that sets the
commandto a relative path now interprets the relative path relative to the book root. Previously it was inconsistent based on the platform (either relative to the current directory, or relative to the renderer output directory). Paths relative to the output directory are still supported with a deprecation warning. #1418 - The
themedirectory in the config is now interpreted as relative to the book root, instead of the current directory. #1405 - Handle UTF-8 BOM for chapter sources. #1285
- Removed extra whitespace added to
{{#playground}}snippets. #1375
Fixed
- Clicking on a search result with multiple search words will now correctly highlight all of the words. #1426
- Properly handle
<and>characters in the table of contents. #1376 - Fixed to properly serialize the
buildtable in the config, which prevented setting it in the API. #1378
mdBook 0.4.5
Fixed
- Fixed XSS in the search page. CVE-2020-26297 648c9ae
mdBook 0.4.4
Added
- Added the
output.html.print.enableconfiguration value to disable the "print" page. #1169 - Added a list of supported languages for syntax-highlighting to the documentation. #1345
Fixed
- Now supports symbolic links for files in the
srcdirectory. #1323
mdBook 0.4.3
Added
- Added
output.html.cnameoption to emit aCNAMEfile which is used by GitHub Pages to know which domain is being used. #1311
Changed
mdbook testno longer stops on the first test failure, but instead will run all the tests. #1313- Removed the
localfont source for Source Code Pro, as the locally installed font may not render properly on FireFox on macOS. #1307
Fixed
- Added newline to end of
.nojekyllfile. #1310 - Fixed missing space before draft chapter titles. #1309
mdBook 0.4.2
Changed
- The "show hidden lines" icon has changed from the "expand" icon to an "eye". #1281
- Updated highlight.js. This adds several languages: c, c-like (effectively cpp), csharp (replaces cs), kotlin, less, lua, php-template, plaintext, python-repl, r, scss, typescript. #1277
Fixed
- Fixed SUMMARY links that contained newlines. #1291
- Fixed SUMMARY links that contain
%20spaces. #1293 - Fixed favicon so that if only the png or svg is overridden, the other is not
automatically included in the
<link>tag. #1272
mdBook 0.4.1
Changed
- Removed several outdated dev-dependencies. #1267
Fixed
- Fixed sidebar scrolling if the book includes part titles. #1265
- Don't include the default favicon if only one of the PNG or SVG is overridden. #1266
mdBook 0.4.0
Breaking Changes
- Several of the changes in the release have altered the public API of the mdbook library.
- Many dependencies have been updated or replaced.
This also removes the
--websocket-hostnameand--websocket-portfrom theservecommand. #1211 - A new "404" page is now automatically rendered. This requires knowledge of
the base URL of your site to work properly. If you decide to use this as
your 404 page, you should set the
site-urlsetting in the book configuration so mdbook can generate the links correctly. Alternatively you can disable the 404 page generation, or set up your own 404 handling in your web server. #1221 - The
debugandoutputfeatures have been removed as they were unused. #1211 - If you are using customized themes, you may want to consider setting the
preferred-dark-themeconfig setting, as it now defaults to "navy". #1199 - "Playpen" has been renamed to "playground". This is generally backwards
compatible for users, but
{{#playpen}}will now display warnings. This may impact books that have modified the "playpen" elements in the theme. #1241 - If a renderer is not installed, it is now treated as an error. If you want
the old behavior of ignoring missing renderers, set the
optionalsetting for that renderer. #1122 - If you have a custom favicon, you may need to look into adding an SVG version, otherwise the default SVG icon will be displayed. #1230
Added
- Added a new
[rust]configuration section tobook.toml, which allows setting the default edition withedition = "2018". #1163 - Renderers can now be marked as
optional, so that they will be ignored if the renderer is not installed. #1122 - Added
head.hbsto allow adding content to the<head>section in HTML. #1206 - Added "draft chapters". These are chapters listed without a link to indicate content yet to be written. #1153
- Added "parts" to split a book into different sections. Headers can be added
to
SUMMARY.mdto signify different sections. #1171 - Added generation of a "404" page for handling missing pages and broken links. #1221
- Added configuration section for specifying URL redirects. #1237
- Added an SVG favicon that works with light and dark colors schemes. #1230
Changed
- Changed default Rust attribute of
allow(unused_variables)toallow(unused). #1195 - Fonts are now served locally instead of from the Google Fonts CDN. The
copy-fontsoption was added to disable this if you want to supply your own fonts. #1188 - Switched the built-in webserver for the
servecommand to a new implementation. This results in some internal differences in how websockets are handled, which removes the separate websocket options. This should also make it easier to serve multiple books at once. #1211 - The default dark theme is now "navy". #1199
- "Playpen" has been renamed to "playground", matching the actual name of the service which was renamed many years ago. #1241
Fixed
- Links with the
+symbol should now work. #1208 - The
MDBOOK_BOOKenvironment variable now correctly allows overriding the entire book configuration. #1207 - The sidebar can no longer be dragged outside of the window. #1229
- Hide the Rust Playground "play" button for
no_runcode samples. #1249 - Fixed the
--dest-dircommand-line option for theserveandwatchcommands. #1228 - Hotkey handlers are now disabled in
textinput fields (for example, typingSin a custom text input field). #1244
mdBook 0.3.7
Changed
- Code spans in headers are no longer highlighted as code. #1162
- The sidebar will now scroll the activate page to the middle instead of the top. #1161
- Reverted change to reject build output within the
srcdirectory, and instead add a check that prevents infinite copies. #1181 #1026
Fixed
mdBook 0.3.6
Added
MDBook::execute_build_processis now publicly accessible in the API so that plugins can more easily initiate the build process. #1099
Changed
- Use a different color for Ayu theme's highlighting for Rust attributes (uses a bright color instead of the comment color). #1133
- Adjusted spacing of sidebar entries. #1137
- Slightly adjusted line-height of
<p>,<ul>, and<ol>. #1136 - Handlebars updated to 3.0. #1130
Fixed
- Fix an issue with sidebar scroll position on reload. #1108
mdbook servewill retain the current scroll position when the page is reloaded. #1097- Fixed the page name if the book didn't have a title to not be prefixed with
-. #1145 - HTML attributes
rel=nextandrel=previousare now supported in "wide" mode (previously they were only set in narrow mode). #1150 - Prevent recursive copies when the destination directory is contained in the source directory. #1135
- Adjusted the menu bar animation to not immediately obscure the top content. #989
- Fix for comments in SUMMARY.md that appear between items. #1167
mdBook 0.3.5
Changed
- The
default-themeconfig setting is now case-insensitive. #1079
Fixed
- Fixed
#hidden Rust code lines not rendering properly. #1088 - Updated pulldown-cmark to 0.6.1, fixing several issues. #1021
mdBook 0.3.4
Changed
- Switch to relative
remfont sizes frompx. #894 - Migrated repository to https://github.com/rust-lang/mdBook/ #1083
mdBook 0.3.3
Changed
- Improvements to the automatic dark theme selection. #1069
- Fragment links now prevent scrolling the header behind the menu bar. #1077
Fixed
- Fixed error when building a book that has a spacer immediately after the first chapter. #1075
mdBook 0.3.2
Added
- Added a markdown renderer, which is off by default. This may be useful for debugging preprocessors. #1018
- Code samples may now include line numbers with the
output.html.playpen.line-numbersconfiguration value. #1035 - The
watchandservecommands will now ignore files listed in.gitignore. #1044 - Added automatic dark-theme detection based on the CSS
prefers-color-schemefeature. This may be enabled by settingoutput.html.preferred-dark-themeto your preferred dark theme. #1037 - Added
rustdoc_includepreprocessor. This makes it easier to include portions of an external Rust source file. The rest of the file is hidden, but the user may expand it to see the entire file, and will continue to work withmdbook test. #1003 - Added Ctrl-Enter shortcut to the playpen editor to automatically run the sample. #1066
- Added
output.html.playpen.copyableconfiguration option to disable the copy button. #1050 - Added ability to dynamically expand and fold sections within the sidebar.
See the
output.html.foldconfiguration to enable this feature. #1027
Changed
- Use standard
scrollbar-colorCSS along with webkit extension #816 - The renderer build directory is no longer deleted before the renderer is run. This allows a backend to cache results between runs. #985
- Next/prev links now highlight on hover to indicate it is clickable. #994
- Increase padding of table headers. #824
- Errors in
[output.html]config are no longer ignored. #1033 - Updated highlight.js for syntax highlighting updates (primarily to add async/await to Rust highlighting). #1041
- Raised minimum supported rust version to 1.35. #1003
- Hidden code lines are no longer dynamically removed via JavaScript, but instead managed with CSS. #846 #1065
- Changed the default font set for the ACE editor, giving preference to "Source Code Pro". #1062
- Windows 32-bit releases are no longer published. #1071
Fixed
- Fixed sidebar auto-scrolling. #1052
- Fixed error message when running
cleanmultiple times. #1055 - Actually fix the "next" link on index.html. The previous fix didn't work. #1005
- Stop using
inline-blockforinline code, fixing selection highlighting and some rendering issues. #1058 - Fix header auto-hide on browsers with momentum scrolling that allows
negative
scrollTop. #1070
mdBook 0.3.1
Added
- 🔥 Added ability to include files using anchor points instead of line numbers. #851
- Added
languageconfiguration value to set the language of the book, which will affect things like the<html lang="en">tag. #941
Changed
- Updated to handlebars 2.0. #977
Fixed
- Fixed memory leak warning. #967
- Fix more print.html links. #963
- Fixed crash on some unicode input. #978
mdBook 0.3.0
Added
- Added ability to resize the sidebar. #849
- Added
load_with_config_and_summaryfunction toMDBookto be able to build a book with a customSummary. #883 - Set
noindexonprint.htmlpage to prevent robots from indexing it. #844 - Added support for
strikethroughand GitHub-style tasklists. #952
Changed
- Command-line help output is now colored. #861
- The build directory is now deleted before rendering starts, instead of after if finishes. #878
- Removed dependency on
same-filecrate. #903 - 💥 Renamed
with_preprecessortowith_preprocessor. #906 - Updated ACE editor to 1.4.4, should remove a JavaScript console warning. #935
- Dependencies have been updated. #934 #945
- Highlight.js has been updated. This fixes some TOML highlighting, and adds Julia support. #942
- 🔥 Updated to pulldown-cmark 0.5. This may have significant changes to the formatting of existing books, as the newer version has more accurate interpretation of the CommonMark spec and a large number of bug fixes and changes. #898
- The
difflanguage should now highlight correctly. #943 - Make the blank region of a header not clickable. #948
- Rustdoc tests now use the preprocessed content instead of the raw, unpreprocessed content. #891
Fixed
- Fixed file change detection so that
mdbook serveonly reloads once when multiple files are changed at once. #870 - Fixed on-hover color highlighting for links in sidebar. #834
- Fixed loss of focus when clicking the "Copy" button in code blocks. #867
- Fixed incorrectly stripping the path for
additional-jsfiles. #796 - Fixed color of
code spansthat are links. #905 - Fixed "next" navigation on index.html. #916
- Fixed keyboard chapter navigation for
fileurls. #915 - Fixed bad wrapping for inline code on some browsers. #818
- Properly load an existing
SUMMARY.mdinmdbook init. #841 - Fixed some broken links in
print.html. #871 - The Rust Playground link now supports the 2018 edition. #946
mdBook 0.2.3 (2018-01-18)
Added
- Added an optional button to the top of the page which will link to a git
repository. Use the
git-repository-urlandgit-repository-iconoptions in the[output.html]section to enable it and set its appearance. #802 - Added a
default-themeoption to the[output.html]section. #804
Changed
- 💥 Header ID anchors no longer add an arbitrary
acharacter for headers that start with a non-ascii-alphabetic character. #788
Fixed
mdBook 0.2.2 (2018-10-19)
Added
-
🎉 Process-based custom preprocessors. See the docs for more. #792
-
🎉 Configurable preprocessors.
Added
build.use-default-preprocessorsboolean TOML key to allow disabling the built-inlinksandindexpreprocessors.Added
[preprocessor]TOML tables to configure each preprocessor.Specifying
[preprocessor.links]or[preprocessor.index]will enable the respective built-in preprocessor ifbuild.use-default-preprocessorsisfalse.Added
fn supports_renderer(&self, renderer: &str) -> boolto thePreprocessortrait to specify if the preprocessor supports the given renderer. The default implementation always returnstrue.Preprocessor::runnow takes a book by value instead of a mutable reference. It should return aBookvalue with the intended modifications.Added
PreprocessorContext::rendererto indicate the renderer being used.
Fixed
- Fix paths to additional CSS and JavaScript files #777
- Ensure section numbers are correctly incremented after a horizontal separator #790
mdBook 0.2.1 (2018-08-22)
Changed
- Update to handlebars-rs 1.0 #761
Fixed
- Fix table colors, broken by Stylus -> CSS transition #765
mdBook 0.2.0 (2018-08-02)
Changed
-
💥 This release changes how links are handled in mdBook. Previously, relative links were interpreted relative to the book's root. In
0.2.0+ links are relative to the page they are in, and use the.mdextension. This has several advantages, such as making links work in other markdown viewers like GitHub. You will likely have to change links in your book to accommodate this change. For example, a book with this layout:chapter_1/ section_1.md section_2.md SUMMARY.mdPreviously a link in
section_1.mdtosection_2.mdwould look like this:[section_2](chapter_1/section_2.html)Now it must be changed to this:
[section_2](section_2.md) -
💥
mdbook test --library-pathnow accepts a comma-delimited list of arguments rather than taking all following arguments. This makes it easier to handle the trailing book directory argument without always needing to put--before it. Multiple instances of the option continue to be accepted:mdbook test -L foo -L bar. -
💥
mdbook servehas some of its options renamed for clarity. Seemdbook help servefor details. -
Embedded rust playpens now use the "stable" playground API. #754