wiki/content/20201119165454-rustdoc.md

39 lines
717 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-11-19
2024-05-06 20:40:05 +00:00
id: f878143f-448c-4a1a-9a6e-7d2bf5a174ca
title: rustdoc
---
# Description
Rustdoc[^1] is the built in library documentation tool included in the
Rust distribution and allows you to write documentation in Markdown[^2].
# Syntax
``` rust
pub mod foo {
/// Some docs for `Foo`
///
/// You may want to use `Foo` with [`Bar`].
///
/// [`Bar`]: ../bar/struct.Bar.html
pub struct Foo;
}
pub mod bar {
/// Some docs for `Bar`
///
/// You may want to use `Bar` with [`Foo`].
///
/// [`Foo`]: ../foo/struct.Foo.html
pub struct Bar;
}
```
# Footnotes
[^1]: <https://doc.rust-lang.org/rustdoc/index.html>
[^2]: <https://en.wikipedia.org/wiki/Markdown>