Skip to content

Commit 5572d3d

Browse files
committed
Expand on hidelines documentation.
1 parent 1441fe0 commit 5572d3d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

guide/src/format/mdbook.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
## Hiding code lines
44

5-
There is a feature in mdBook that lets you hide code lines by prepending them
6-
with a `#` [like you would with Rustdoc][rustdoc-hide].
5+
There is a feature in mdBook that lets you hide code lines by prepending them with a specific prefix.
76

8-
[rustdoc-hide]: https://doc.rust-lang.org/stable/rustdoc/documentation-tests.html#hiding-portions-of-the-example
7+
For the Rust language, you can use the `#` character as a prefix which will hide lines [like you would with Rustdoc][rustdoc-hide].
8+
9+
[rustdoc-hide]: https://doc.rust-lang.org/stable/rustdoc/write-documentation/documentation-tests.html#hiding-portions-of-the-example
910

1011
```bash
1112
# fn main() {
@@ -27,7 +28,7 @@ Will render as
2728
# }
2829
```
2930

30-
The code block has an eyeball icon (<i class="fa fa-eye"></i>) which will toggle the visibility of the hidden lines.
31+
When you tap or hover the mouse over the code block, there will be an eyeball icon (<i class="fa fa-eye"></i>) which will toggle the visibility of the hidden lines.
3132

3233
By default, this only works for code examples that are annotated with `rust`.
3334
However, you can define custom prefixes for other languages by adding a new line-hiding prefix in your `book.toml` with the language name and prefix character(s):
@@ -59,7 +60,7 @@ nothidden():
5960

6061
This behavior can be overridden locally with a different prefix. This has the same effect as above:
6162

62-
~~~bash
63+
~~~markdown
6364
```python,hidelines=!!!
6465
!!!hidden()
6566
nothidden():

0 commit comments

Comments
 (0)