pmd/docs/_includes/custom/xpath_fun_doc.html

110 lines
3.9 KiB
HTML
Raw Normal View History

2019-03-06 01:29:53 +01:00
{% for lang in site.data.xpath_funs.langs %}
2019-04-05 11:43:07 +02:00
<!-- Generates the documentation of XPath functions. -->
2019-03-06 01:29:53 +01:00
### {{ lang.name }}
2022-03-22 19:46:21 +01:00
{% if lang.header %}
{{ lang.header | render_markdown }}
{% else %}
2019-03-06 01:29:53 +01:00
{{ lang.name }} functions are in the namespace `{{ lang.ns }}`.
2022-03-22 19:46:21 +01:00
{% endif %}
2019-03-06 01:29:53 +01:00
2019-04-05 14:13:39 +02:00
<div class="table-responsive">
<table width="100%">
2019-03-06 02:22:36 +01:00
<thead>
<tr>
<th>Function name</th>
2019-04-07 18:00:02 +02:00
<th>Description (click for details)</th>
2019-04-05 14:13:39 +02:00
<th></th>
2019-03-06 02:22:36 +01:00
</tr>
</thead>
{% for fun in lang.funs %}
2019-04-05 14:13:39 +02:00
{% capture fun_id %}{{ lang.ns | append: '-' | append: fun.name }}{% endcapture %}
2019-04-05 11:43:07 +02:00
2019-04-05 14:13:39 +02:00
<tr data-toggle="collapse" id="{{ fun_id }}" data-target="{{ fun_id | prepend: '#' | append: '-expand' }}" class="accordion-toggle">
2019-03-06 02:22:36 +01:00
<td>{{ fun.name }}</td>
2019-04-05 14:13:39 +02:00
<td>{{ fun.shortDescription }}</td>
2019-03-06 02:22:36 +01:00
<td>
2019-04-05 14:13:39 +02:00
<button type="button" class="btn btn-link"><i
class="fas fa-ellipsis-h"></i></button>
2019-03-06 02:22:36 +01:00
</td>
</tr>
2019-04-05 11:43:07 +02:00
<tr>
<td colspan="4" class="hiddenRow">
2019-04-05 14:13:39 +02:00
<div class="accordion-body collapse" id="{{ fun_id | append: '-expand' }}">
<div style="margin-left: 15px" class="xpath-fun-doc">
2019-04-07 18:25:14 +02:00
<!-- Yeah the ID is duplicated but it's ok on my browser and makes -->
<!--links somehow work when details are collapsed -->
<h4 class="fun-details-header" id="{{ fun_id }}">
2019-04-05 14:13:39 +02:00
<span class="fun-ns">{{ lang.ns | append: ':' }}</span><span
class="fun-name">{{ fun.name }}</span><span
class="fun-ns">{{ fun | xpath_fun_type }}</span>
</h4>
<div style="margin-left: 30px">
<dl>
2019-04-07 18:25:14 +02:00
<dd>{{ fun.description | render_markdown }}</dd>
2022-03-22 19:34:13 +01:00
{% if fun.since %}
<dt>Since</dt>
<dd>PMD {{ fun.since }}</dd>
{% endif %}
2019-04-05 14:13:39 +02:00
<dt>Remarks</dt>
2019-04-07 18:25:14 +02:00
<dd>{{ fun.notes | render_markdown }}</dd>
2019-04-05 14:13:39 +02:00
2019-04-07 18:00:02 +02:00
{% if fun.parameters.size > 0 %}
2019-04-05 14:13:39 +02:00
<dt>Parameters</dt>
<dd>
2019-04-07 18:25:14 +02:00
<dl>
{% for param in fun.parameters %}
<dt>
<span class="param-name">{{ param.name }}</span>
<span class="param-type"> as {{ param.type }}</span>
</dt>
<dd>{{ param.description | render_markdown }}</dd>
{% endfor %}
</dl>
2019-04-05 14:13:39 +02:00
</dd>
2019-04-07 18:00:02 +02:00
{% endif %}
2019-04-05 14:13:39 +02:00
2019-04-07 18:00:02 +02:00
{% if fun.examples.size > 0 %}
2019-04-05 14:13:39 +02:00
2019-04-07 18:00:02 +02:00
<dt>Examples</dt>
2019-04-05 14:13:39 +02:00
2019-04-07 18:00:02 +02:00
<dd>
2019-04-07 18:25:14 +02:00
<dl class="code-examples">
{% for example in fun.examples %}
<dt><code>{{ example.code }}</code></dt>
<dd>{{ example.outcome | render_markdown }}</dd>
{% endfor %}
</dl>
2019-04-07 18:00:02 +02:00
</dd>
{% endif %}
</dl>
2019-04-05 14:13:39 +02:00
</div>
</div>
2019-04-05 11:43:07 +02:00
</div>
</td>
</tr>
2019-03-06 02:22:36 +01:00
{% endfor %}
</table>
</div>
2019-03-06 01:29:53 +01:00
{% endfor %}