Previously, this was only pushing in the opening paragraph tag before
getting to text, so it was accidentally dropping cases where the text
started after some other opening tag, e.g. strong emphasis.
- Add CSS for `figure.listing`; this now renders identically to how the
existing listings render.
- Convert the first listing in the book to use `<Listing>` instead of
a bunch of `<span>`s.
This does not yet update all the workspace dependencies to be shared
between the listing and note preprocessors; it *only* integrates the
repo histories.
Instead of requiring a bunch of `<span>` wrangling, add a custom tag,
`<Listing>`, whose attributes get rewritten into the desired output
format, using `<figure>` and `<figcaption>` for improved semantic HTML.
Support both a default (nice and fancy) HTML output mode and a “simple”
mode to make it so we get the desired output format for the NoStarch
input files as well.
At some point we may want to include these in the workspace, but for
now they need to be excluded so `cargo build` and `rust-analyzer` work
correctly with the workspace layout.
Introduce a `book.toml` in the `nostarch` directory, which matches the
existing `book.toml` except for specifying the correct relative input
and output directories and disabling the `trpl-note` preprocessor. This
also lets us simplify the invocation in the `nostarch.sh` script a bit,
by providing the configuration directly in the file.
Use the newly-introduced `mdbook-trpl-note` to render accessible and
semantic HTML for the notes/callouts in the book. This currently applies
to the nostarch version as well, so a follow-on change will update the
build process to undo that. Add CSS so the new note rendering matches
the existing rendering of blockquotes. (We might want to change that at
some point, but for now the goal is to maximizing continuity.)
I developed this in its own repo before we knew how we wanted to
integrate it. We decided on a workspace, so this pulls it in with all
its development history.
In the destination, this will be part of a Cargo workspace, and should
*not* be in the root, where a merge will conflict with the workspace
Cargo config etc.
The wording change in 66aedb4 made this sentence flow more nicely, but is a misleading because it implies types can't be annotated if there is only one possible type. This changes it back to it's previous order, but replaces "must" with "have to" to keep it's correctness while still flowing more naturally.
Technically it's still incorrect because types have to be annotated in type signatures even if there is only one possible type. Maybe the word "only" in this sentence should be removed?
My inspiration for these included the `aria-label` because the notes did
not have a label like `Note: ` or a heading on them; these do, though.
Keep the `aria-role` so screen readers present notes distinctively the
same way the visual presentation is set off.
Fix README: remove `aria-label` from there as well
In a scenario like this:
```markdown
> This is a quote.
> Note: this is a note
```
The result should be this output:
```markdown
> This is a quote.
<section class="note" aria-label="Note" aria-role="note">
Note: this is a note
</section>
```
The same goes for heading-type notes, and for the inverted flow.
- Rework the `rewrite` function to spit back out Markdown instead of
going all the way to HTML.
- Implement the `Preprocessor` type and wire up a CLI conforming to the
mdBook preprocessor spec.
- Add relevant deps, including for an integration test.
This snapshot contains line wrapping problems, irrelevant comments,
extraneous output lines, and differences we're going to allow between
the online and print version.
The intention is to make this a baseline commit for chapter 7 that we
can diff against to find changes to consider sending to nostarch as tiny
tweaks.