Add build.static-files-dir
config option
#2755
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for a new
build.static-files-dir
config option. It only targets static files, not custom ones. The goal is, when rustdoc officially supports to generate mdbook alongside the API docs, to make this integration easier for docs.rs:I tested this feature locally with:
It's working as expected, files were generated in
/tmp/static
and URLs were pointing to this folder.Now, some questions: what would be the best way to test it in a unit test?
And finally: @syphar, would it be ok for docs.rs (speaking hypothetically for something that hopefully will be supported by rustdoc in the future) to use this new static folder option to generate static files directly in a
/-/mdbook
folder (since we use docker, I suppose we can cheat by creating a/-
folder in any case)? Like that the URLs are already all valid so no need to update them when serving the book files and files are hashed.