- Reformat everything now that the bug in dprint for wrapping lines with
inline code is fixed.
- Additionally, apply the formatting rules I *should have* applied the
first time, so the repo has the same style it has historically used.
- Create an `mdbook_trpl` library package which hosts shared concerns
for the packages, e.g. error and config handling.
- Move `mdbook-trpl-note` and `mdbook-trpl-listing` into the new shared
package, with binaries at `src/bin/(note|listing)/main.rs` and the
existing libraries at `src/note/mod.rs` and `src/listing/mod.rs` with
their associated tests.
- Extract their actual shared pieces into the crate root.
- Update `tools/nostarch.sh` to build all the bins in `mdbook_trpl` at
one time.
At the moment, this doesn't do a lot except trim down the number of
packages in the repository, but it sets things up nicely to support more
preprocessors (which I am going to add shortly).
In addition to the baseline changes, skip over non-directory code where
directories are needed to deal with things like `.DS_Store` files. Also
add a bunch of context on error causes from `std::io::Error` because it
was *impossible* to figure out exactly what the source of those were.
mdBook does not currently have particularly good support for “external”
crates. To make the test suite work correctly with `trpl`, we must first
build `trpl` itself (`mdbook` will not do it), and then explicitly pass
its `deps` path as a library search path for `mdbook test`. That will
make sure all the crates can be resolved when running the tests.
.github/workflows/main.yml
Remove these from the workspace, because they will need to be used as
path dependencies in `rust-lang/rust`, as part of the build, because the
Rust build pipeline invokes mdBook programmatically rather than via
tools built directly, and we really don’t want to muck with publishing
these to crates.io at present. As a result, they cannot be part of this
workspace, because path dependencies do not get built as a crate within
the hosting workspace. Make sure they do not rely on any features other
than the core `mdbook` library.