Skip to content

Conversation

@benfalk
Copy link

@benfalk benfalk commented Dec 19, 2025

The Watcher and Poller already respected .gitignore files when monitoring for changes; however, the HTML Renderer did not. This update ensures that the HTML Renderer also honors .gitignore. This prevents ignored files from being processed and included in the generated HTML output.

I noticed this when working on a project where the mdbook source directory was the root of the project. mdBook was taking a long time to copy the entire contents of the target directory into the book which was gigabytes in size. After this change, the HTML renderer correctly ignored the target directory as specified in the .gitignore file, significantly speeding up the build process.

The Watcher and Poller already respected `.gitignore` files when
monitoring for changes; however, the HTML Renderer did not. This
update ensures that the HTML Renderer also honors `.gitignore`.
This prevents ignored files from being processed and included in
the generated HTML output.

I noticed this when working on a project where the mdbook source
directory was the root of the project.  mdBook was taking a long
time to copy the entire contents of the `target` directory into
the book which was gigabytes in size.  After this change, the HTML
renderer correctly ignored the `target` directory as specified in
the `.gitignore` file, significantly speeding up the build process.
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants