From 5572d3d4de1870968bff55c2ee8ca81839f1255e Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 28 May 2023 13:50:34 -0700 Subject: [PATCH] Expand on hidelines documentation. --- guide/src/format/mdbook.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/guide/src/format/mdbook.md b/guide/src/format/mdbook.md index 485e73a3..2872b250 100644 --- a/guide/src/format/mdbook.md +++ b/guide/src/format/mdbook.md @@ -2,10 +2,11 @@ ## Hiding code lines -There is a feature in mdBook that lets you hide code lines by prepending them -with a `#` [like you would with Rustdoc][rustdoc-hide]. +There is a feature in mdBook that lets you hide code lines by prepending them with a specific prefix. -[rustdoc-hide]: https://doc.rust-lang.org/stable/rustdoc/documentation-tests.html#hiding-portions-of-the-example +For the Rust language, you can use the `#` character as a prefix which will hide lines [like you would with Rustdoc][rustdoc-hide]. + +[rustdoc-hide]: https://doc.rust-lang.org/stable/rustdoc/write-documentation/documentation-tests.html#hiding-portions-of-the-example ```bash # fn main() { @@ -27,7 +28,7 @@ Will render as # } ``` -The code block has an eyeball icon () which will toggle the visibility of the hidden lines. +When you tap or hover the mouse over the code block, there will be an eyeball icon () which will toggle the visibility of the hidden lines. By default, this only works for code examples that are annotated with `rust`. 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(): This behavior can be overridden locally with a different prefix. This has the same effect as above: -~~~bash +~~~markdown ```python,hidelines=!!! !!!hidden() nothidden():