Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group rules by type in appendix legend #1261

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 11 additions & 23 deletions appendix.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,36 +72,24 @@ If you're here to choose a license, **[start from the home page](/)** to see a f

<p>Most open source licenses also have <span class="license-limitations"><span class="license-sprite"></span></span> <b>limitations</b> that usually disclaim warranty and liability, and sometimes expressly exclude patents or trademarks from licenses' grants.</p>

{% assign seen_tags = '' %}
{% for type in types %}
### {% if type == "permissions" %}Permissions{% elsif type == "conditions" %}Conditions{% else %}Limitations{% endif %}
<dl>
{% assign rules = site.data.rules[type] | sort: "label" %}
{% for rule_obj in rules %}
{% assign req = rule_obj.tag %}
{% if seen_tags contains req %}
{% continue %}
{% endif %}
<dt id="{{ req }}">{{ rule_obj.label }}</dt>
{% capture seen_tags %}{{ seen_tags | append:req }}{% endcapture %}
{% for t in types %}
{% assign rs = site.data.rules[t] | sort: "label" %}
{% for r in rs %}
{% if r.tag == req %}
{% if r.tag contains "--" %}
{% assign lite = " lite" %}
{% else %}
{% assign lite = "" %}
{% endif %}
<dd class="license-{{t}}">
<span class="{{ r.tag | append: lite }}">
<span class="license-sprite {{ r.tag }}"></span>
</span>
{{ r.description }}
</dd>
{% endif %}
{% endfor %}
{% endfor %}
<dd class="license-{{ type }}">
{% if req contains "--" %}
{% assign lite = " lite" %}
{% else %}
{% assign lite = "" %}
{% endif %}
<span class="{{ req | append: lite }}">
<span class="license-sprite {{ req }}"></span>
</span>
{{ rule_obj.description }}
</dd>
{% endfor %}
</dl>
{% endfor %}