Skip to content

Commit

Permalink
Merge branch 'main' into fix/indexing-docs-components
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgepiloto authored Oct 23, 2024
2 parents 3040dac + ff89444 commit cf2b16e
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 73 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/doc-changelog@v8
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
- uses: ansys/actions/doc-changelog@v8
if: ${{ github.event_name == 'pull_request '}}
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}

code-style:
name: Code style
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/556.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: cleanup autoapi templates using macros
1 change: 1 addition & 0 deletions doc/changelog.d/566.documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chore: update CHANGELOG for v1.1.7
8 changes: 8 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ This document contains the release notes for the project.
.. towncrier release notes start
`1.1.7 <https://github.com/ansys/ansys-sphinx-theme/releases/tag/v1.1.7>`_ - 2024-10-23
=======================================================================================

Miscellaneous
^^^^^^^^^^^^^

- fix: ensure app.builder.outdir is a Path object `#565 <https://github.com/ansys/ansys-sphinx-theme/pull/565>`_

`1.1.6 <https://github.com/ansys/ansys-sphinx-theme/releases/tag/v1.1.6>`_ - 2024-10-18
=======================================================================================

Expand Down
3 changes: 2 additions & 1 deletion src/ansys_sphinx_theme/search/fuse_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"""Module for generating search indices."""

import json
from pathlib import Path
import re

from docutils import nodes
Expand Down Expand Up @@ -167,6 +168,6 @@ def create_search_index(app, exception):
search_index.build_sections()
search_index_list.extend(search_index.indices)

search_index_path = app.builder.outdir / "_static" / "search.json"
search_index_path = Path(app.builder.outdir) / "_static" / "search.json"
with search_index_path.open("w", encoding="utf-8") as index_file:
json.dump(search_index_list, index_file, ensure_ascii=False, indent=4)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,39 @@
- {{ obj.summary }}
{% endfor %}
{%- endmacro %}
{# --------------------------- End macros definition ----------------------- #}

{# ------------------------ End macros definition for tab ------------------- #}

{# ----------------- Start macros definition for autosummary -----------------#}

{% macro render_autosummary_section(title, members) -%}

{{ title }}
{{ "-" * title | length }}

.. autoapisummary::

{% for member in members %}
{{ member.id }}
{% endfor %}

{%- endmacro %}
{# ------------------ End macros definition for autosummary --------------- #}

{# ----------------- Start macros definition for headers -----------------#}

{% macro render_members_section(title, members) -%}

{{ title }}
{{ "-" * title | length }}

{% for member in members %}
{{ member.render() }}
{% endfor %}

{%- endmacro %}
{# ------------------ End macros definition for headers --------------- #}


{% if is_own_page %}
:class:`{{ obj.name }}`
Expand Down Expand Up @@ -140,84 +172,40 @@ Import detail
from {{ joined_parts }} import {{ obj["short_name"] }}
{% if visible_properties %}
Property detail
---------------
{% for property in visible_properties %}
{{ property.render() }}
{% endfor %}
{{ render_members_section("Property detail", visible_properties) }}
{% endif %}


{% if visible_attributes %}
Attribute detail
----------------
{% for attribute in visible_attributes %}
{{ attribute.render() }}
{% endfor %}
{% if visible_attributes %}
{{ render_members_section("Attribute detail", visible_attributes) }}
{% endif %}


{% if all_visible_methods %}
Method detail
-------------
{% for method in all_visible_methods %}
{{ method.render() }}
{% endfor %}
{% if all_visible_methods %}
{{ render_members_section("Method detail", all_visible_methods) }}
{% endif %}

{% if is_own_page and own_page_children %}
{% set visible_attributes = own_page_children|selectattr("type", "equalto", "attribute")|list %}
{% if visible_attributes %}
Attributes
----------

.. autoapisummary::

{% for attribute in visible_attributes %}
{{ attribute.id }}
{% endfor %}


{% endif %}
{% set visible_exceptions = own_page_children|selectattr("type", "equalto", "exception")|list %}
{% if visible_exceptions %}
Exceptions
----------

.. autoapisummary::

{% for exception in visible_exceptions %}
{{ exception.id }}
{% endfor %}


{% endif %}
{% set visible_classes = own_page_children|selectattr("type", "equalto", "class")|list %}
{% if visible_classes %}
Classes
-------

.. autoapisummary::

{% for klass in visible_classes %}
{{ klass.id }}
{% endfor %}


{% endif %}
{% set visible_methods = own_page_children|selectattr("type", "equalto", "method")|list %}
{% if visible_methods %}
Methods
-------
{% if visible_attributes %}
{{ autosummary_section("Attributes", visible_attributes) }}
{% endif %}
{% set visible_exceptions = own_page_children|selectattr("type", "equalto", "exception")|list %}

.. autoapisummary::
{% if visible_exceptions %}
{{ autosummary_section("Exceptions", visible_exceptions) }}
{% endif %}
{% set visible_classes = own_page_children|selectattr("type", "equalto", "class")|list %}

{% for method in visible_methods %}
{{ method.id }}
{% endfor %}
{% if visible_classes %}
{{ autosummary_section("Classes", visible_classes) }}

{% endif %}
{% set visible_methods = own_page_children|selectattr("type", "equalto", "method")|list %}

{% endif %}
{% if visible_methods %}
{{ autosummary_section("Methods", visible_methods) }}
{% endif %}
{% endif %}

{# ---------------------- End class details -------------------- #}
{% endif %}
{% endif %}

0 comments on commit cf2b16e

Please sign in to comment.