File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 48
48
- [ Documentation] ( ./documentation/summary.md )
49
49
- [ doc alias policy] ( ./documentation/doc-alias-policy.md )
50
50
- [ safety comments policy] ( ./documentation/safety-comments.md )
51
- - [ how to write documentation] ( ./how-to-write-documentation.md )
52
- - [ reviewing doc changes] ( ./reviewing-doc-changes.md )
51
+ - [ how to write documentation] ( ./documentation/ how-to-write-documentation.md )
52
+ - [ reviewing doc changes] ( ./documentation/ reviewing-doc-changes.md )
53
53
54
54
---
55
55
Original file line number Diff line number Diff line change @@ -60,9 +60,11 @@ blocks by default). It allows us to know if the documentation is up to date. As
60
60
such, please avoid using ` ignore ` as much as possible on code blocks! If you
61
61
want as a language other than Rust, simply set it in the code block tags:
62
62
63
- ```text
64
- This is not rust code!
65
- ```
63
+ ```` text
64
+ ```text
65
+ This is not rust code!
66
+ ```
67
+ ````
66
68
67
69
Some special cases:
68
70
* If the code example cannot be run (when documenting a I/O item for example),
@@ -99,7 +101,7 @@ The basic format of each documented methods/functions should roughly look like t
99
101
By ` explanations ` we mean that the text should explain what the method and what
100
102
each of its arguments are for. Let's take this method for example:
101
103
102
- ``` rust
104
+ ``` rust,ignore
103
105
pub fn concat_str(&self, s: &str) -> String {
104
106
if s.is_empty() {
105
107
panic!("empty concat string");
@@ -134,12 +136,14 @@ It is better if you use `assert*!` macros at the end to ensure that the example
134
136
is working as expected. It also allows the readers to understand more easily
135
137
what the function is doing (or returning).
136
138
137
- # Examples
139
+ ```` text
140
+ # Examples
138
141
139
- ```
140
- let s = MyType::new("hello ");
141
- assert_eq!("hello Georges", s.concat_str("Georges").as_str());
142
- ```
142
+ ```
143
+ let s = MyType::new("hello ");
144
+ assert_eq!("hello Georges", s.concat_str("Georges").as_str());
145
+ ```
146
+ ````
143
147
144
148
## How to write documentation for other items
145
149
You can’t perform that action at this time.
0 commit comments