Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc json output on stdout ? #127165

Closed
gl-yziquel opened this issue Jun 30, 2024 · 6 comments · Fixed by #128963
Closed

rustdoc json output on stdout ? #127165

gl-yziquel opened this issue Jun 30, 2024 · 6 comments · Fixed by #128963
Labels
A-rustdoc-json Area: Rustdoc JSON backend C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@gl-yziquel
Copy link

Hi.

As of today, it seems that there is no out of the box way to get rustdoc json output on stdout. I see no way to augment the rustdoc src/lib.rs -Zunstable-options --output-format json invocation to handle output on stdout.

This is a shame as I'd like to perform rustdoc -> some jq or better for preprocessing -> tera templating -> makeinfo for texinfo generation, all of that through pipes.

As of today, the only piece of code that doesn't support piping in the above is rustdoc.

Being kind of a dinosaur, I like to get things done the old unixish way, with one tool doing something and only that, and having pipe support would allow to generate my texinfo manual from rustdoc json output without having to go jumping through hoops using temporary files.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 30, 2024
@veera-sivarajan
Copy link
Contributor

@rustbot label -needs-triage +T-rustdoc +A-rustdoc-json +C-enhancement

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 30, 2024
@chenyukang

This comment was marked as off-topic.

@jyn514

This comment was marked as off-topic.

@aDotInTheVoid

This comment was marked as off-topic.

@gl-yziquel

This comment was marked as off-topic.

@GuillaumeGomez
Copy link
Member

I think it's a good idea. Adding it.

@bors bors closed this as completed in 6c242a0 Aug 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 15, 2024
Rollup merge of rust-lang#128963 - GuillaumeGomez:output-to-stdout, r=aDotInTheVoid

Add possibility to generate rustdoc JSON output to stdout

Fixes rust-lang#127165.

I think it's likely common to want to get rustdoc json output directly instead of reading it from a file so I added this option to allow it. It's unstable and only works with `--output-format=json`.

r? `@aDotInTheVoid`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants