Skip to content

Commit e13bbd3

Browse files
committed
Add example for docs
1 parent e17cd8b commit e13bbd3

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

‎src/rustdoc-json-types/lib.rs‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,27 @@ pub struct Item {
289289
/// so this field is needed to differentiate.
290290
pub visibility: Visibility,
291291
/// The full markdown docstring of this item. Empty if there is no documentation at all,
292-
/// `vec![Doc { text: "" }]` if there is some documentation but it is empty (EG `#[doc = ""]`).
292+
/// `vec![Doc { text: "" }]` if there is some documentation but it is empty (EG `#[doc = ""]`),
293+
/// and multiple items if a reexport and the original both have docstrings.
294+
///
295+
/// ```rust
296+
/// /// Reexport docs
297+
/// pub use Thing1 as Thing2;
298+
///
299+
/// /// Original docs
300+
/// pub struct Thing1;
301+
/// ```
302+
///
303+
/// ```json
304+
/// {
305+
/// "name": "Thing2",
306+
/// "docs": [
307+
/// { "text": "Reexport docs", "links": [] },
308+
/// { "text": "Original docs", "links": [] },
309+
/// ],
310+
/// ...
311+
/// }
312+
/// ```
293313
pub docs: Vec<Doc>,
294314
/// Attributes on this item.
295315
///

0 commit comments

Comments
 (0)