GitHub

@@ -19,35 +19,37 @@ Context:

1919

-#}

2020

{{ log.debug("Rendering docstring") }}

2121

{% endblock logs %}

22-

{% for section in docstring_sections %}

23-

{% if config.show_docstring_description and section.kind.value == "text" %}

24-

{{ section.value|convert_markdown(heading_level, html_id) }}

25-

{% elif config.show_docstring_attributes and section.kind.value == "attributes" %}

26-

{% include "docstring/attributes"|get_template with context %}

27-

{% elif config.show_docstring_functions and section.kind.value == "functions" %}

28-

{% include "docstring/functions"|get_template with context %}

29-

{% elif config.show_docstring_classes and section.kind.value == "classes" %}

30-

{% include "docstring/classes"|get_template with context %}

31-

{% elif config.show_docstring_modules and section.kind.value == "modules" %}

32-

{% include "docstring/modules"|get_template with context %}

33-

{% elif config.show_docstring_parameters and section.kind.value == "parameters" %}

34-

{% include "docstring/parameters"|get_template with context %}

35-

{% elif config.show_docstring_other_parameters and section.kind.value == "other parameters" %}

36-

{% include "docstring/other_parameters"|get_template with context %}

37-

{% elif config.show_docstring_raises and section.kind.value == "raises" %}

38-

{% include "docstring/raises"|get_template with context %}

39-

{% elif config.show_docstring_warns and section.kind.value == "warns" %}

40-

{% include "docstring/warns"|get_template with context %}

41-

{% elif config.show_docstring_yields and section.kind.value == "yields" %}

42-

{% include "docstring/yields"|get_template with context %}

43-

{% elif config.show_docstring_receives and section.kind.value == "receives" %}

44-

{% include "docstring/receives"|get_template with context %}

45-

{% elif config.show_docstring_returns and section.kind.value == "returns" %}

46-

{% include "docstring/returns"|get_template with context %}

47-

{% elif config.show_docstring_examples and section.kind.value == "examples" %}

48-

{% include "docstring/examples"|get_template with context %}

49-

{% elif config.show_docstring_description and section.kind.value == "admonition" %}

50-

{% include "docstring/admonition"|get_template with context %}

51-

{% endif %}

52-

{% endfor %}

22+

{% with autoref_hook = AutorefsHook(obj, config) %}

23+

{% for section in docstring_sections %}

24+

{% if config.show_docstring_description and section.kind.value == "text" %}

25+

{{ section.value|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}

26+

{% elif config.show_docstring_attributes and section.kind.value == "attributes" %}

27+

{% include "docstring/attributes"|get_template with context %}

28+

{% elif config.show_docstring_functions and section.kind.value == "functions" %}

29+

{% include "docstring/functions"|get_template with context %}

30+

{% elif config.show_docstring_classes and section.kind.value == "classes" %}

31+

{% include "docstring/classes"|get_template with context %}

32+

{% elif config.show_docstring_modules and section.kind.value == "modules" %}

33+

{% include "docstring/modules"|get_template with context %}

34+

{% elif config.show_docstring_parameters and section.kind.value == "parameters" %}

35+

{% include "docstring/parameters"|get_template with context %}

36+

{% elif config.show_docstring_other_parameters and section.kind.value == "other parameters" %}

37+

{% include "docstring/other_parameters"|get_template with context %}

38+

{% elif config.show_docstring_raises and section.kind.value == "raises" %}

39+

{% include "docstring/raises"|get_template with context %}

40+

{% elif config.show_docstring_warns and section.kind.value == "warns" %}

41+

{% include "docstring/warns"|get_template with context %}

42+

{% elif config.show_docstring_yields and section.kind.value == "yields" %}

43+

{% include "docstring/yields"|get_template with context %}

44+

{% elif config.show_docstring_receives and section.kind.value == "receives" %}

45+

{% include "docstring/receives"|get_template with context %}

46+

{% elif config.show_docstring_returns and section.kind.value == "returns" %}

47+

{% include "docstring/returns"|get_template with context %}

48+

{% elif config.show_docstring_examples and section.kind.value == "examples" %}

49+

{% include "docstring/examples"|get_template with context %}

50+

{% elif config.show_docstring_description and section.kind.value == "admonition" %}

51+

{% include "docstring/admonition"|get_template with context %}

52+

{% endif %}

53+

{% endfor %}

54+

{% endwith %}

5355

{% endif %}

Read the original on github.com ↗