max-heller / mdbook-pandoc

A mdbook backend powered by Pandoc.
Apache License 2.0
97 stars 7 forks source link

Respect the `.gitignore` and `.mdbookignore` files #111

Open Bergmann89 opened 3 weeks ago

Bergmann89 commented 3 weeks ago

If you use the root directory of the repository as source directory for mdbook, mdbook-pandoc will copy all files, including the book directory where the output is rendered to, to the output directory. This result in an infinite loop until the disk is full, or the paths are too long to be handled.

mdbook has a not yet merged PR to have a separate .mdbookignore file similar to .gitignore (see here).

This pull requests implements support for the .mdbookignore and the .gitignore file.

max-heller commented 2 weeks ago

Thanks for the review! I'll wait for the mdbook PR to be merged before reviewing closely.

Can we use the recursive iterator provided by ignore instead of having a recursive copy function?

Bergmann89 commented 2 weeks ago

Thanks for the review! I'll wait for the mdbook PR to be merged before reviewing closely.

Alright :+1:

Can we use the recursive iterator provided by ignore instead of having a recursive copy function?

Sure. I will add this later.