mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Support for HTML Renderer to honor `.gitignore`

Open benfalk opened this issue 1 month ago • 0 comments

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.

benfalk avatar Dec 19 '25 11:12 benfalk