Skip to content

Commit 127c3ad

Browse files
authored
Rollup merge of #40466 - projektir:outdated_docs_highlighting, r=steveklabnik
Remove doc about highlighting code in other languages #40301 This doesn't appear to be true any longer, so removing it to avoid confusion. See #40301 Thoughts: - may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point; - does `text` still work? r? @steveklabnik
2 parents cfca6fc + eb203d5 commit 127c3ad

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/doc/book/src/documentation.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ more than one section:
170170
# fn foo() {}
171171
```
172172

173-
Let's discuss the details of these code blocks.
174-
175173
#### Code block annotations
176174

177175
To write some Rust code in a comment, use the triple graves:
@@ -183,23 +181,8 @@ To write some Rust code in a comment, use the triple graves:
183181
# fn foo() {}
184182
```
185183

186-
If you want something that's not Rust code, you can add an annotation:
187-
188-
```rust
189-
/// ```c
190-
/// printf("Hello, world\n");
191-
/// ```
192-
# fn foo() {}
193-
```
194-
195-
This will highlight according to whatever language you're showing off.
196-
If you're only showing plain text, choose `text`.
197-
198-
It's important to choose the correct annotation here, because `rustdoc` uses it
199-
in an interesting way: It can be used to actually test your examples in a
200-
library crate, so that they don't get out of date. If you have some C code but
201-
`rustdoc` thinks it's Rust because you left off the annotation, `rustdoc` will
202-
complain when trying to generate the documentation.
184+
This will add code highlighting. If you are only showing plain text, put `text`
185+
instead of `rust` after the triple graves (see below).
203186

204187
## Documentation as tests
205188

0 commit comments

Comments
 (0)