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

GitHub workflow to preview documentation changes/builds with example changes #2057

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
remove redundancy from subset documentation pages
sujaypatil96 committed Jun 10, 2024
commit 124c6be107d0d765634abbe7755236d45713144e
2 changes: 1 addition & 1 deletion .github/workflows/test_pages_build.yaml
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ jobs:
version: 1.3.2

- name: Install dependencies
run: poetry install --with docs --all-extras
run: poetry install -E docs

- name: Build documentation
run: |
20 changes: 10 additions & 10 deletions src/doc-templates/subset.md.jinja2
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@ URI: {{ gen.link(element) }}
{% set enums_in_subset = [] %}

{# Collect classes, slots, and enumerations in subset #}
{% for c in gen.all_class_objects() %}
{% for c in gen.all_class_objects()|sort(attribute=sort_by) %}
{%- if element.name in c.in_subset %}
{% set _ = classes_in_subset.append(c) %}
{%- endif %}
{% endfor %}

{% for s in gen.all_slot_objects() %}
{% for s in gen.all_slot_objects()|sort(attribute=sort_by) %}
{%- if element.name in s.in_subset %}
{% set _ = slots_in_subset.append(s) %}
{%- endif %}
@@ -43,31 +43,31 @@ URI: {{ gen.link(element) }}

| Class | Description |
| --- | --- |
{% for c in gen.all_class_objects()|sort(attribute=sort_by) -%}
{% for c in classes_in_subset -%}
{%- if element.name in c.in_subset -%}
| {{gen.link(c)}} | {{c.description|enshorten}} |
{% endif -%}
{% endfor %}

{% for c in gen.all_class_objects()|sort(attribute=sort_by) -%}
{% for c in classes_in_subset -%}
{%- if element.name in c.in_subset -%}
### {{ gen.name(c) }}

{{c.description}}
{% set induced_slots = gen.class_induced_slots(c.name)|sort(attribute=sort_by) %}

{%- set filtered_slots = [] -%}

{%- for s in induced_slots|sort(attribute=sort_by) -%}
{%- if element.name in s.in_subset or element.name in schemaview.get_slot(s.name).in_subset -%}
{% set _ = filtered_slots.append(s) %}
{%- endif -%}
{%- endfor %}

{%- if filtered_slots|length > 0 -%}
| Name | Cardinality and Range | Description |
### Slots from {{ gen.link(c) }} also in _{{ element.name }}_

| Name | Cardinality and Range | Description |
| --- | --- | --- |
{% for s in filtered_slots -%}
| {{gen.link(s)}} | {{ gen.cardinality(s) }} <br/> {{gen.link(s.range)}} | {{s.description|enshorten}} {% if s.identifier %}**identifier**{% endif %} |
| {{gen.link(s)}} | {{ gen.cardinality(s) }} <br/> {{gen.link(s.range)}} | {{s.description|enshorten}} {% if s.identifier %}**identifier**{% endif %} |
{% endfor %}
{%- endif %}

@@ -103,4 +103,4 @@ URI: {{ gen.link(element) }}
{%- endif %}
{% endfor %}

{%- endif %}
{%- endif %}
Loading