rust-lang / rust-lang/mdBook

Included markdown files are not update with `mdbook serve`

Open
#2,536 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug Command-watch
Dominant language
Rust
Stars
22.2k
Forks
1.9k
PR merge metrics
PR metrics pending

Description

Problem

Files included with {{#include path/to/file}} are not updated with mdbook serve, and it seems there is no option to manually add files to be watched.

In our (maturin), we include the readme as introduction page in the guide to avoid repeating the content from the readme.

Steps
  1. git clone https://github.com/konstin/mkbook-watch-reproducer
  2. mdbook serve guide and open the page in the browser
  3. Edit installation.md. The changes are updated in the browser.
  4. Edit Readme.md. The changes are not updated in the browser! You need to run mdbook build guide to rebuild them.
Possible Solution(s)

mdbook should watch included files, too, or add an option to manually include them. I tried extra-watch-dirs with .., with an absolute path and with the path to the directory, but to no avail.

Notes

No response

Version
0.4.43 and dff5ac64e59c9c8df7327eba22561770fd65e958

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mdbook serve guide workflow and the linked mkbook-watch-reproducer; compare edits to installation.md with edits to the included Readme.md. Verify that changes to included files refresh the browser without requiring a separate mdbook build guide, using the reported version and commit as the baseline.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, rust
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.