mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2025-01-30 19:33:53 +01:00
Documented the use of line ranges in hl_lines (#2903)
Co-authored-by: Vedran Miletić <vedran@miletic.net>
This commit is contained in:
parent
b7e5b3d8fc
commit
d7894a3f02
@ -368,6 +368,30 @@ def bubble_sort(items):
|
|||||||
items[j], items[j + 1] = items[j + 1], items[j]
|
items[j], items[j + 1] = items[j + 1], items[j]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Line ranges can also be used for conveniently specifying multiple lines.
|
||||||
|
|
||||||
|
_Example_:
|
||||||
|
|
||||||
|
```` markdown
|
||||||
|
``` python hl_lines="2-5"
|
||||||
|
def bubble_sort(items):
|
||||||
|
for i in range(len(items)):
|
||||||
|
for j in range(len(items) - 1 - i):
|
||||||
|
if items[j] > items[j + 1]:
|
||||||
|
items[j], items[j + 1] = items[j + 1], items[j]
|
||||||
|
```
|
||||||
|
````
|
||||||
|
|
||||||
|
_Result_:
|
||||||
|
|
||||||
|
``` python hl_lines="2-5"
|
||||||
|
def bubble_sort(items):
|
||||||
|
for i in range(len(items)):
|
||||||
|
for j in range(len(items) - 1 - i):
|
||||||
|
if items[j] > items[j + 1]:
|
||||||
|
items[j], items[j + 1] = items[j + 1], items[j]
|
||||||
|
```
|
||||||
|
|
||||||
### Highlighting inline code blocks
|
### Highlighting inline code blocks
|
||||||
|
|
||||||
When [InlineHilite][21] is enabled, inline code blocks can be highlighted by
|
When [InlineHilite][21] is enabled, inline code blocks can be highlighted by
|
||||||
|
Loading…
x
Reference in New Issue
Block a user