mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Prevent mdBook from recursively copying all files in src to dest

Open spmadden opened this issue 2 years ago • 1 comments

Problem

In a large multi-module mono-repository, it doesn't always make sense to have your book documentation locked into a single folder/book module. Each module should be able to contribute it's own set of markdown files to the common "book".

I can get 90% of the way there by putting a book.toml and SUMMARY.md file at the root of the repository, and setting src = '.' in book.toml. However, this then copies the entire repository to the output/dest directory, which is obviously inadvisable.

Proposed Solution

Until we get some of the other PRs closed with better relative & absolute links support (which will solve my problem a better way), recommend adding a flag to disable the recursive file copy in the HTML renderer at https://github.com/rust-lang/mdBook/blob/master/src/renderer/html_handlebars/hbs_renderer.rs#L631 , which will give me the final behavior I'm looking for.

Notes

No response

spmadden avatar Nov 24 '23 04:11 spmadden

See https://github.com/rust-lang/mdBook/issues/1187 and #1156.

sanmai-NL avatar Mar 01 '24 12:03 sanmai-NL