Conversation
|
These commits modify Please ensure that if you've changed the output:
cc @obi1kenobi rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing |
|
rustbot has assigned @GuillaumeGomez. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
9c1da60 to
2f5048f
Compare
This comment has been minimized.
This comment has been minimized.
2f5048f to
fcbb219
Compare
This comment has been minimized.
This comment has been minimized.
fcbb219 to
605cfeb
Compare
This comment has been minimized.
This comment has been minimized.
605cfeb to
97e368b
Compare
This comment has been minimized.
This comment has been minimized.
This change is a pre-requisite for LaTeX support, because the markdown parser doesn't support enabling and disabling extensions in the middle of a document, and there's no way to add that. This means string concatenating a document that has LaTeX Math disabled with a document that has it enabled can't be done. As part of this change, a bug related to intra-doc links is fixed. This shows up when the reexport and the item both have intra-doc links with the same visible path, but where they resolve to different items. The bug is demonstrated in `tests/rustdoc-html/reexport/link-with-same-name-but-different-destination.rs`. The other test case changes demonstrate that this is, technically, a breaking change. When I ran a Crater test for docs that rely on this behavior, though, it seemed most authors weren't relying on it.
97e368b to
e1cc402
Compare
| pub links: HashMap<String, Id>, | ||
| /// The full markdown docstring of this item. Empty if there is no documentation at all, | ||
| /// `vec![Doc { text: "" }]` if there is some documentation but it is empty (EG `#[doc = ""]`). | ||
| pub docs: Vec<Doc>, |
There was a problem hiding this comment.
I'm curious, when might this Vec have more than one element?
It might be useful to include an example in the doc comment, for ease of use.
There was a problem hiding this comment.
Good call. I've added an example and some description to the docs.
The full markdown docstring of this item. Empty if there is no documentation at all,
vec![Doc { text: "" }]if there is some documentation but it is empty (EG#[doc = ""]),
and multiple items if a reexport and the original both have docstrings./// Reexport docs pub use Thing1 as Thing2; /// Original docs pub struct Thing1;{ "name": "Thing2", "docs": [ { "text": "Reexport docs", "links": [] }, { "text": "Original docs", "links": [] }, ], ... }
There was a problem hiding this comment.
Ah interesting! Nice, thank you.
Is any particular order of elements guaranteed? That's the only remaining thing I'd consider adding.
This change is a pre-requisite for LaTeX support, because the markdown parser doesn't support enabling and disabling extensions in the middle of a document, and there's no way to add that. This means string concatenating a document that has LaTeX Math disabled with a document that has it enabled can't be done.
As part of this change, a bug related to intra-doc links is fixed. This shows up when the reexport and the item both have intra-doc links with the same visible path, but where they resolve to different items. The bug is demonstrated in
tests/rustdoc-html/reexport/link-with-same-name-but-different-destination.rs.The other test case changes demonstrate that this is, technically, a breaking change. When I ran a Crater test for docs that rely on this behavior, though, it seemed most authors weren't relying on it.