This makes several changes to how footnotes are rendered:
- Backlinks are now included, which links back to the reference so you
can continue reading where you left off.
- Footnotes are moved to the bottom of the page. This helps with the
implementation of numbering, and is a style some have requested. I
waffled a lot on this change, but supporting the in-place style was
just adding too much complexity.
- Footnotes are now highlighted when you click on a reference.
- Some of the spacing for elements within a footnote has now been fixed
(such as supporting multiple paragraphs).
- Footnote navigation now scrolls to the middle of the page.
This is an alternative to https://github.com/rust-lang/mdBook/pull/2475
Closes https://github.com/rust-lang/mdBook/issues/1927
Closes https://github.com/rust-lang/mdBook/issues/2169
Closes https://github.com/rust-lang/mdBook/issues/2595
This fixes a problem where the search was not displaying in
sub-directories. The problem was that `searcher.js` only exists in one
place, and was loading `searchindex.json` with a relative path. However,
when loading from a subdirectory, it needs the appropriate `..` to reach
the root of the book.
This fixes an issue where mdbook would panic if a non-draft chapter has
a None source_path when generating the search index. The code was
assuming that only draft chapters would have that behavior. However, API
users can inject synthetic chapters that have no path on disk.
This updates it to fall back to the path, or skip if neither is set.
This config setting provides the ability to disable search indexing on a
per-chapter (or sub-path) basis.
This is structured to possibly add additional settings, such as perhaps
a score multiplier or other settings.
previous implementation used `:not(.fd) + .fd` and `.fd + :not(.fd)`.
the latter selector caused many problems:
- it doesn't select footnote defs which are last children
(this can be easily triggered in a blockquote)
- it changes the margin of the next sibling, rather than the footnote def
itself, which can also *shrink* margin for elements with big margins
(this happens to headings)
- because it applies to the next sibling it is also quite hard to
override in user styles, since it may apply to any element
this commit replaces the latter selector with `:not(:has(+ .fd))`,
which fixes all of the mentioned problems.