Skip to content

Commit fadcf94

Browse files
authored
Merge pull request #1453 from adafruit/turn-libraries-into-links
Turn libraries list on board pages into links
2 parents 62b41f6 + fcd127c commit fadcf94

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

_includes/download/board.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,29 @@ <h3>CircuitPython {{ version.version }}</h3>
147147
{% if version.modules %}
148148
<p>
149149
Built-in modules available:
150-
<span class="download-modules {% if version.stable %}stable{% else %}unstable{% endif %}">{{ version.modules | join: ', ' }}</span>
150+
<span class="download-modules {% if version.stable %}stable{% else %}unstable{% endif %}">
151+
{% for module_name in version.modules %}
152+
{% if module_name contains "." %}
153+
<a target="_blank" class="library-link" href="https://docs.circuitpython.org/en/latest/shared-bindings/{{ module_name | split: '.' | first }}/#{{ module_name }}">
154+
{% else %}
155+
<a target="_blank" class="library-link" href="https://docs.circuitpython.org/en/latest/shared-bindings/{{ module_name }}">
156+
{% endif %}
157+
{{ module_name }}
158+
</a>{% if module_name != version.modules[version.modules.size - 1] %}, {% endif %}
159+
{% endfor %}
160+
</span>
151161
</p>
152162
{% endif %}
153163
{% if version.frozen_libraries and version.frozen_libraries.size != 0 %}
154164
<p>
155165
Included frozen<sup><a href="https://docs.circuitpython.org/en/latest/docs/reference/glossary.html?highlight=frozen#term-frozen-module" title="What is a frozen module">(?)</a></sup> modules:
156-
<span class="download-modules {% if version.stable %}stable{% else %}unstable{% endif %}">{{ version.frozen_libraries | join: ', ' }}</span>
166+
<span class="download-modules {% if version.stable %}stable{% else %}unstable{% endif %}">
167+
{% for module_name in version.frozen_libraries %}
168+
<a target="_blank" class="library-link" href="https://docs.circuitpython.org/projects/{{ module_name | split: 'adafruit_' | last }}">
169+
{{ module_name }}
170+
</a>{% if module_name != version.frozen_libraries[version.frozen_libraries.size - 1] %}, {% endif %}
171+
{% endfor %}
172+
</span>
157173
</p>
158174
{% endif %}
159175
</div>

0 commit comments

Comments
 (0)