You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code blocks can include a button to allow for the selection of line ranges by
93
+
the user, which is perfect for linking to a specific subsection of a code block. This allows the user to apply [line highlighting] dynamically. Add the following
94
+
to `mkdocs.yml` to enable it globally:
95
+
96
+
``` yaml
97
+
theme:
98
+
features:
99
+
- content.code.select
100
+
```
101
+
102
+
??? info "Enabling or disabling code selection buttons for a specific code block"
103
+
104
+
If you don't want to enable code selection buttons globally, you can enable
105
+
them for a specific code block by using a slightly different syntax based on
106
+
the [Attribute Lists] extension:
107
+
108
+
````yaml
109
+
``` { .yaml .select }
110
+
# Code block content
111
+
```
112
+
````
113
+
114
+
Note that the language shortcode which has to come first must now also be
115
+
prefixed by a `.`. Similarly, the selection button can also be disabled for
0 commit comments