Skip to content

Commit 7c72edf

Browse files
Update documentation for custom_code_classes_in_docs feature
1 parent f038f18 commit 7c72edf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/doc/rustdoc/src/unstable-features.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ to jump to a type definition.
631631
```rust
632632
#![feature(custom_code_classes_in_docs)]
633633

634-
/// ```{class=language-c}
634+
/// ```custom,{class=language-c}
635635
/// int main(void) { return 0; }
636636
/// ```
637637
pub struct Bar;
@@ -641,12 +641,16 @@ The text `int main(void) { return 0; }` is rendered without highlighting in a co
641641
with the class `language-c`. This can be used to highlight other languages through JavaScript
642642
libraries for example.
643643

644+
Without the `custom` attribute, it would be generated as a Rust code example with an additional
645+
`language-C` CSS class. Therefore, if you specifically don't want it to be a Rust code example,
646+
don't forget to add the `custom` attribute.
647+
644648
To be noted that you can replace `class=` with `.` to achieve the same result:
645649

646650
```rust
647651
#![feature(custom_code_classes_in_docs)]
648652

649-
/// ```{.language-c}
653+
/// ```custom,{.language-c}
650654
/// int main(void) { return 0; }
651655
/// ```
652656
pub struct Bar;

0 commit comments

Comments
 (0)