Add input in mdbook to rebuild
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.2k
- Forks
- 1.9k
- PR merge metrics
- PR metrics pending
Description
Problem
This is specifically focused on the new test support in mdbook-spec, but in general, mdbook serve does not check for files outside of the watch tree (src/ dir + include entries), and there's no way to force it to rebuild without SIGINTing and rerunning the command. In the case of mdbook-spec, this means that it doesn't watch the thousands (10,000s) of test files for updates.
Proposed Solution
A terminal keystroke, such as ^R (Control+R), could be checked for while listening to changes, and when read from stdin, rebuild the book and trigger a rebuild.
Notes
An alternative on unix specifically is to listen to a particular signal. However, neither of the two signals designed for an arbitrary purpose are triggered by a keystroke.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the mdbook serve implementation, focusing on its change-listening loop and how it handles terminal input. Determine how a Control+R keystroke can trigger a rebuild without restarting the command, then verify that rebuilding works for files outside the watch tree, including mdbook-spec test files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100