Skip to content

Commit

Permalink
fix: Only show source when present
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Nov 28, 2021
1 parent dbb580a commit c270d68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{% include "docstring.html" with context %}
{% endwith %}

{% if config.show_source %}
{% if config.show_source and class.source %}
<details class="quote">
<summary>Source code in <code>{{ class.relative_filepath }}</code></summary>
{{ class.source|highlight(language="python", linestart=class.lineno, linenums=True) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
{% include "docstring.html" with context %}
{% endwith %}

{% if config.show_source %}
{% if config.show_source and function.source %}
<details class="quote">
<summary>Source code in <code>{{ function.relative_filepath }}</code></summary>
{{ function.source|highlight(language="python", linestart=function.lineno, linenums=True) }}
Expand Down

0 comments on commit c270d68

Please sign in to comment.