|
1 | 1 | {{ log.debug() }}
|
2 | 2 | {% if config.docstring_section_style == "table" %}
|
| 3 | + {% set name_column = section.value|selectattr("name")|any %} |
3 | 4 | <p><strong>{{ section.title or "Receives:" }}</strong></p>
|
4 | 5 | <table>
|
5 | 6 | <thead>
|
6 | 7 | <tr>
|
| 8 | + {% if name_column %}<th>Name</th>{% endif %} |
7 | 9 | <th>Type</th>
|
8 | 10 | <th>Description</th>
|
9 | 11 | </tr>
|
10 | 12 | </thead>
|
11 | 13 | <tbody>
|
12 |
| - <tr> |
13 |
| - {% with receives = section.value %} |
| 14 | + {% for receives in section.value %} |
| 15 | + <tr> |
| 16 | + {% if name_column %}<td>{% if receives.name %}<code>{{ receives.name }}</code>{% endif %}</td>{% endif %} |
14 | 17 | <td>
|
15 | 18 | {% if receives.annotation %}
|
16 | 19 | {% with expression = receives.annotation %}
|
|
19 | 22 | {% endif %}
|
20 | 23 | </td>
|
21 | 24 | <td>{{ receives.description|convert_markdown(heading_level, html_id) }}</td>
|
22 |
| - {% endwith %} |
23 |
| - </tr> |
| 25 | + </tr> |
| 26 | + {% endfor %} |
24 | 27 | </tbody>
|
25 | 28 | </table>
|
26 | 29 | {% elif config.docstring_section_style == "list" %}
|
27 | 30 | <p>{{ section.title or "Receives:" }}</p>
|
28 | 31 | <ul>
|
29 |
| - {% with receives = section.value %} |
| 32 | + {% for receives in section.value %} |
30 | 33 | <li class="field-body">
|
| 34 | + {% if receives.name %}<b>{{ receives.name }}</b>{% endif %} |
31 | 35 | {% if receives.annotation %}
|
32 | 36 | {% with expression = receives.annotation %}
|
| 37 | + {% if receives.name %}({% endif %} |
33 | 38 | <code>{% include "expression.html" with context %}</code>
|
| 39 | + {% if receives.name %}){% endif %} |
34 | 40 | {% endwith %}
|
35 |
| - – |
36 | 41 | {% endif %}
|
37 |
| - {{ receives.description|convert_markdown(heading_level, html_id) }} |
| 42 | + – {{ receives.description|convert_markdown(heading_level, html_id) }} |
38 | 43 | </li>
|
39 |
| - {% endwith %} |
| 44 | + {% endfor %} |
40 | 45 | </ul>
|
41 | 46 | {% elif config.docstring_section_style == "spacy" %}
|
42 | 47 | <table>
|
|
47 | 52 | </tr>
|
48 | 53 | </thead>
|
49 | 54 | <tbody>
|
50 |
| - {% for receive in section.value %} |
| 55 | + {% for receives in section.value %} |
51 | 56 | <tr>
|
52 |
| - <td><code>{{ receive.name }}</code></td> |
53 |
| - <td class="doc-receive-details"> |
54 |
| - {{ receive.description|convert_markdown(heading_level, html_id) }} |
55 |
| - <p> |
56 |
| - {% if receive.annotation %} |
57 |
| - <span class="doc-receive-annotation"> |
| 57 | + <td> |
| 58 | + {% if receives.name %} |
| 59 | + <code>{{ receives.name }}</code> |
| 60 | + {% elif receives.annotation %} |
| 61 | + <span class="doc-receives-annotation"> |
| 62 | + {% with expression = receives.annotation %} |
| 63 | + <code>{% include "expression.html" with context %}</code> |
| 64 | + {% endwith %} |
| 65 | + </span> |
| 66 | + {% endif %} |
| 67 | + </td> |
| 68 | + <td class="doc-receives-details"> |
| 69 | + {{ receives.description|convert_markdown(heading_level, html_id) }} |
| 70 | + {% if receives.name and receives.annotation %} |
| 71 | + <p> |
| 72 | + <span class="doc-receives-annotation"> |
58 | 73 | <b>TYPE:</b>
|
59 |
| - {% with expression = receive.annotation %} |
| 74 | + {% with expression = receives.annotation %} |
60 | 75 | <code>{% include "expression.html" with context %}</code>
|
61 | 76 | {% endwith %}
|
62 | 77 | </span>
|
63 |
| - {% endif %} |
64 |
| - </p> |
| 78 | + </p> |
| 79 | + {% endif %} |
65 | 80 | </td>
|
66 | 81 | </tr>
|
67 | 82 | {% endfor %}
|
|
0 commit comments