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

Tracking Issue for --output-format flag for cargo rustdoc #13283

Open
1 of 3 tasks
weihanglo opened this issue Jan 11, 2024 · 2 comments
Open
1 of 3 tasks

Tracking Issue for --output-format flag for cargo rustdoc #13283

weihanglo opened this issue Jan 11, 2024 · 2 comments
Labels
C-tracking-issue Category: A tracking issue for something unstable. Command-rustdoc

Comments

@weihanglo
Copy link
Member

weihanglo commented Jan 11, 2024

Summary

Original issue: #12103
Implementation: #12252
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#output-format-for-rustdoc

This flag determines the output format of cargo rustdoc, providing tools a way to lean on rustdoc's experimental JSON format.

Unresolved Issues

  • Make sure it doesn't cause errors with --open flag when opening JSON file.
  • Interaction with -Z rustdoc-scrape-examples. Does the JSON include the scraped data? Or should scraping be disabled when generating the JSON?
  • Add it to cargo doc as well? We might need to address the output JSON name conflict.

Future Extensions

No response

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

@weihanglo weihanglo added Command-rustdoc C-tracking-issue Category: A tracking issue for something unstable. labels Jan 11, 2024
@weihanglo weihanglo changed the title Tracking Issue for cargo rustdoc --output-format Tracking Issue for --output-format flag for cargo rustdoc Jan 11, 2024
@charmitro
Copy link
Contributor

Unresolved Issues

* [ ]  Make sure it doesn't cause errors with `--open` flag when opening JSON file.

* [ ]  Interaction with [`-Z rustdoc-scrape-examples`](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#scrape-examples). Does the JSON include the scraped data? Or should scraping be disabled when generating the JSON?

* [ ]  Add it to `cargo doc` as well? We might need to address the output JSON name conflict.

I'll try to have some answers for these three unresolved issues and reach back with my observations.

@charmitro
Copy link
Contributor

Make sure it doesn't cause errors with --open flag when opening JSON file.

This has been tested on macOS and works as intended. Unfortunately, I do not have access to a Windows machine to perform the same test there.

Interaction with -Z rustdoc-scrape-examples. Does the JSON include the scraped data? Or should scraping be disabled when generating the JSON?

I cannot see the scraped data in the JSON, but it is visible in the HTML documentation. @weihanglo, it would be advisable to ensure that if both -Z rustdoc-scrape-example and --output-format json flags are used together, an error message is generated for the user.

Add it to cargo doc as well? We might need to address the output JSON name conflict.

Yes, I believe we should also add it to cargo doc. Why conflict though? Does cargo doc generate a different HTML file compared to cargo rustdoc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for something unstable. Command-rustdoc
Projects
Status: Unstable, baking
Development

No branches or pull requests

2 participants