Skip to content

Commit

Permalink
fix: Respect highlight's linenums config for pycon examples in do…
Browse files Browse the repository at this point in the history
…cstrings

The reasoning is that someone enabling line numbers globally supposedly also wants them for code blocks in docstrings. There's in my opinion no difference between a code block in a Markdown document and a code block in a docstring, they both serve documentation purposes and should be subject to the same rendering rules.

If that makes someone unhappy, we can always consider adding an option to hide line numbers for code blocks in docstrings.

Related-to-#192: #192
  • Loading branch information
pawamoy committed Nov 26, 2024
1 parent 101a6dc commit 53eb82a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Context:
{% if section_type.value == "text" %}
{{ sub_section|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
{% elif section_type.value == "examples" %}
{{ sub_section|highlight(language="pycon", linenums=False) }}
{{ sub_section|highlight(language="pycon") }}
{% endif %}
{% endfor %}

0 comments on commit 53eb82a

Please sign in to comment.