I'm able to generate docs in JSON for my own library.
rustdoc -Z unstable-options --output-format json --out-dir=json_docs src/lib.rs
However no luck in finding a way to do so for the the whole Rust standard library. Is it possible?
In most cases you don't need to generate the docs, the JSON rustdoc for the standard library is available with the rust-docs-json
rustup component:
rustup component add --toolchain nightly rust-docs-json
If you do need to generate them, clone the repo (--depth=1
is enough) and execute
python x.py doc library -- --output-format=json