When implementing multi-os support for rustdoc, I have the issue of not having a way to pass all the .rs files of the project to rustdoc.
Which forces me to use "cargo doc", which has this capability. But then I don't have most configuration options available on rustdoc, and I'm forced to create the docs on target/doc.
Please, implement a rustdoc argument to detect all .rs files from the current directory, recursively.
There’s cargo rustdoc to run rustdoc against the current crate with a set of extra arguments. Rustdoc cannot generally be run against just the .rs files from a cargo project, it relies on other metadata that cargo passes, like --extern flags. (And rustdoc doesn’t run against individual files, it runs a crate at a time just like rustc, which for a cargo project is generally just the root src/lib.rs).
Yes, by reading the official docs before posting here I got that impression.
I understand "cargo rustdoc" is the prefered way to generate documentation. Specially if as you say, cargo metadata is necessary to generate correct project documentation. And also considering with rustdoc we would have to assume the user project structure, which we don't know.
What I don't get is why do you have more configuration options in rustdoc (like enabling dark mode) while you don't have those in "cargo rustdoc". Are there planned to be added to "cargo doc" in the future?
All rustdoc flags can be used with cargo rustdoc if you want them to apply to just the current project, like cargo rustdoc -- --document-private-items, they can also be used with cargo doc if you want them to apply to all dependencies too RUSTDOCFLAGS=--document-private-items cargo doc.