1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! The stylesheet of the [`toc`](super) feature on the `html` backend,
//! `flm.toc.style` ([`stylesheet`]), and the markup it selects on.
//!
//! On the HTML page the table of contents is written with the same
//! presentation elements as on every other output ([`rules`](super::rules)),
//! and the HTML backend writes them as its HTML contract states (see
//! [`CONVENTIONS`](crate::stdlib::backends::html::CONVENTIONS)): the block of
//! role `flm.toc` is a `<nav>` carrying the role `doc-toc`, each list a `<ul>`,
//! each entry an `<li>` holding the link to its heading, the number in a span
//! of role `flm.toc.entry.number`. Each `<li>` carries its heading's level as
//! `data-flm-level`, the attribute the heading itself carries, so that one
//! selector `[data-flm-level="N"]` matches the headings of level N and their
//! entries. For `\section{One}\subsection{Two}` under numbering:
//!
//! ```html
//! <nav class="flm-pres-block flm-toc" role="doc-toc" data-flm-kind="toc">
//! <ul class="flm-pres-list" data-flm-kind="unnumbered toc">
//! <li data-flm-level="1"><a class="flm-pres-link" href="#sec--One" data-flm-kind="toc"><span class="flm-pres-span flm-toc-entry-number">1</span> One</a>
//! <ul class="flm-pres-list" data-flm-kind="unnumbered toc">
//! <li data-flm-level="2"><a class="flm-pres-link" href="#sec--Two" data-flm-kind="toc"><span class="flm-pres-span flm-toc-entry-number">1.1</span> Two</a></li>
//! </ul>
//! </li>
//! </ul>
//! </nav>
//! ```
//!
//! The general rule of the root ([`RootRule`](super::rules::RootRule))
//! requires the feature's style identifier [`STYLE`] (`flm.toc.style`), which
//! on this backend names the stylesheet: one cascade layer that removes the
//! list markers, indents each nested list and leaves a space below the table,
//! the indentation and the space custom properties it declares
//! (`--flm-toc-indent`, `--flm-toc-space-below`). It sets structure only; a
//! page that wants another presentation adds a stylesheet of its own, or
//! replaces this one through the render option
//! [`definitions`](crate::stdlib::backends::html::HtmlRenderOptions::definitions).
use crate;
use crateName;
use STYLE;
/// The feature's style definition, `flm.toc.style` ([`STYLE`]): the lists
/// without a marker, each nested list indented and a space below the table, in
/// one cascade layer, with the indentation and the space custom properties it
/// declares (`--flm-toc-indent`, `--flm-toc-space-below`). The
/// space after an entry's number is text the entry's rule writes, not a rule
/// of the stylesheet. See the [module documentation](self).
/// Registers the stylesheet ([`stylesheet`]).
///
/// # Errors
///
/// The [`BuildError`] of the registry builder when a declaration is made
/// outside the registration round that accepts it.
pub