new-horizons/docs/content/base/schema/json/section_properties.jinja2
Ben C 2552d1b8a4
Added XML Schemas To Docs (#57)
* Add Bootstrap Extension

* Rename main.yml

* Artifact Upload

* Fix Bootstrap Reference Error

* BootstrapTreeProcessor

* getiterator removed

* keys function

* Style Images

* Update docs_build.yml

* Added Meta Files

* Template Get

* Fix Page Ref

* Update BASE_URL

* Sort Schemas

* Add Sitemaps

* Add favicons, open-graph, and setup guide

* Update Setup.md

* Update .gitignore

* Update Setup.md

* Use _blank on external links

* Restructured Docs

* Fix Links

* Added XML Schemas

* Name XML Schemas
2022-03-04 23:27:26 -08:00

65 lines
3.4 KiB
Django/Jinja

{% from "base/macros.jinja2" import badge %}
{% set html_id = sub_property.html_id %}
<div class="row my-2">
<div class="col">
<div class="accordion" id="accordion{{ html_id }}">
<div class="accordion-item">
<h2 class="accordion-header" id="heading{{ html_id }}">
<button class="accordion-button{% if not expanded %} collapsed{% endif %}" type="button"
data-bs-toggle="collapse"
data-bs-target="#{{ html_id }}"
aria-expanded="{{ expanded }}" aria-controls="{{ html_id }}"
onclick="setAnchor('#{{ html_id }}')">
{% if sub_property.is_additional_properties %}
<em>
{% endif %}
<span class="property-nam align-middle pb-1">{{ sub_property.property_display_name | upper_first | escape }}</span>
{% if sub_property.is_additional_properties %}
</em>
{% endif %}
{% macro subprop_badge(type, content) %}{{ badge(type, content|title, "required-property, ms-2") }}{% endmacro %}
{% if sub_property.is_required_property %}
{{ " " }}{{ subprop_badge('warning', "Required") }}
{% endif %}
{% if sub_property is deprecated %}
{{ " " }}{{ subprop_badge('danger', "Deprecated") }}
{% endif %}
{% if sub_property.is_pattern_property %}
{{ " " }}{{ subprop_badge('info', "Pattern Property") }}
{% endif %}
</button>
</h2>
<div id="{{ html_id }}"
class="accordion-collapse collapse{% if expanded %} show{% endif %}"
aria-labelledby="heading{{ html_id }}"
data-parent="#accordion{{ html_id }}">
<div class="accordion-body">
{% if sub_property.is_pattern_property %}
<h2 class="handle">
<label>Pattern Property</label>
</h2>
<p>All property whose name matches the following regular expression must respect the
following
conditions</p>
<span class="pattern-value">Property name regular expression: <code>{{ sub_property.property_name | escape }}</code></span>
<br/>
{% endif %}
{% if sub_property.is_additional_properties %}
{% if sub_property.is_additional_properties_schema %}
<p class="additional-properties">Each additional property must conform to the following
schema</p>
{% else %}
<p class="additional-properties">Additional Properties of any type are allowed.</p>
{% endif %}
{% endif %}
{{ content(sub_property) }}
</div>
</div>
</div>
</div>
</div>
</div>