Get doc JSON only from specified crate

I'm running this:

cargo rustdoc --package blaahh -- -Zunstable-options --output-format json

But I get a large JSON, which contains docs for unrelated things. This blaahh is just a binary with no Cargo dependencies and just this code:

fn main() {
    println!("Hello, world!");
}

Are you refering to the index key? This seems to include all public items of the local crate and also all dependencies. I don't think there is a way to make it only look at the local crate. You should be able to just ignore the rest if necessary though.

1 Like

But there are no dependencies... do you mean the std and core? That's what I'm getting:

https://gist.githubusercontent.com/hydroper/d0c45afae3bf0744e046406144a14090/raw/a610945543f027ea03bbabb6d9c4c4ed92e6e0f4/rustdoc-issue.txt

Yeah, the standard library and all of it's dependencies. (core, alloc, std, backtrace, gimli, object, hashbrown, libc, ...)

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.