Skip to content

Fix broken links and invalid code blocks #39

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

Merged
merged 2 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
- [Documentation](./documentation/summary.md)
- [doc alias policy](./documentation/doc-alias-policy.md)
- [safety comments policy](./documentation/safety-comments.md)
- [how to write documentation](./how-to-write-documentation.md)
- [reviewing doc changes](./reviewing-doc-changes.md)
- [how to write documentation](./documentation/how-to-write-documentation.md)
- [reviewing doc changes](./documentation/reviewing-doc-changes.md)

---

Expand Down
22 changes: 13 additions & 9 deletions src/documentation/how-to-write-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ blocks by default). It allows us to know if the documentation is up to date. As
such, please avoid using `ignore` as much as possible on code blocks! If you
want as a language other than Rust, simply set it in the code block tags:

```text
This is not rust code!
```
````text
```text
This is not rust code!
```
````

Some special cases:
* If the code example cannot be run (when documenting a I/O item for example),
Expand Down Expand Up @@ -99,7 +101,7 @@ The basic format of each documented methods/functions should roughly look like t
By `explanations` we mean that the text should explain what the method and what
each of its arguments are for. Let's take this method for example:

```rust
```rust,ignore
pub fn concat_str(&self, s: &str) -> String {
if s.is_empty() {
panic!("empty concat string");
Expand Down Expand Up @@ -134,12 +136,14 @@ It is better if you use `assert*!` macros at the end to ensure that the example
is working as expected. It also allows the readers to understand more easily
what the function is doing (or returning).

# Examples
````text
# Examples

```
let s = MyType::new("hello ");
assert_eq!("hello Georges", s.concat_str("Georges").as_str());
```
```
let s = MyType::new("hello ");
assert_eq!("hello Georges", s.concat_str("Georges").as_str());
```
````

## How to write documentation for other items

Expand Down