Skip to content

Commit 809b541

Browse files
committed
docs: Add extension to filter the lines to show in code
Add the [pymdownx-superfence-filter-lines] markdown extension to be able to filter the lines to show in code examples. This is useful when having examples that need to be valid (pass linting or tests) but still want to avoid showing all the boilerplate to the user. [pymdownx-superfence-filter-lines]: https://github.com/frequenz-floss/pymdownx-superfence-filter-lines-python Signed-off-by: Leandro Lucarella <[email protected]>
1 parent b1473c2 commit 809b541

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

mkdocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ markdown_extensions:
8383
- name: mermaid
8484
class: mermaid
8585
format: !!python/name:pymdownx.superfences.fence_code_format
86+
- name: "*"
87+
class: "highlight"
88+
format: !!python/name:pymdownx_superfence_filter_lines.do_format
89+
validator: !!python/name:pymdownx_superfence_filter_lines.do_validate
8690
- pymdownx.tabbed
8791
- pymdownx.tasklist:
8892
custom_checkbox: true

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ dev-mkdocs = [
5656
"mkdocs-macros-plugin == 1.0.5",
5757
"mkdocs-material == 9.5.6",
5858
"mkdocstrings[python] == 0.24.0",
59+
"pymdownx-superfence-filter-lines == 0.1.0",
5960
]
6061
dev-mypy = [
6162
# For checking the noxfile, docs/ script, and tests

0 commit comments

Comments
 (0)