From d5ced49c31f109c6c2a649ddaadee9b576f84c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADnez?= <28702884+jorgepiloto@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:53:16 +0200 Subject: [PATCH 1/4] fix: ensure app.builder.outdir is a Path object (#565) Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> --- doc/changelog.d/565.miscellaneous.md | 1 + src/ansys_sphinx_theme/search/fuse_search.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 doc/changelog.d/565.miscellaneous.md diff --git a/doc/changelog.d/565.miscellaneous.md b/doc/changelog.d/565.miscellaneous.md new file mode 100644 index 00000000..1313047c --- /dev/null +++ b/doc/changelog.d/565.miscellaneous.md @@ -0,0 +1 @@ +fix: ensure app.builder.outdir is a Path object \ No newline at end of file diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index c7b35457..4e6539ac 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -23,6 +23,7 @@ """Module for generating search indices.""" import json +from pathlib import Path import re from docutils import nodes @@ -147,6 +148,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) From cafd615a5ec5f6d4c672c175f650fdee0f0f1f3b Mon Sep 17 00:00:00 2001 From: PyAnsys CI Bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:03:19 +0200 Subject: [PATCH 2/4] chore: update CHANGELOG for v1.1.7 (#566) --- doc/changelog.d/565.miscellaneous.md | 1 - doc/changelog.d/566.documentation.md | 1 + doc/source/changelog.rst | 8 ++++++++ 3 files changed, 9 insertions(+), 1 deletion(-) delete mode 100644 doc/changelog.d/565.miscellaneous.md create mode 100644 doc/changelog.d/566.documentation.md diff --git a/doc/changelog.d/565.miscellaneous.md b/doc/changelog.d/565.miscellaneous.md deleted file mode 100644 index 1313047c..00000000 --- a/doc/changelog.d/565.miscellaneous.md +++ /dev/null @@ -1 +0,0 @@ -fix: ensure app.builder.outdir is a Path object \ No newline at end of file diff --git a/doc/changelog.d/566.documentation.md b/doc/changelog.d/566.documentation.md new file mode 100644 index 00000000..ec906a4c --- /dev/null +++ b/doc/changelog.d/566.documentation.md @@ -0,0 +1 @@ +chore: update CHANGELOG for v1.1.7 \ No newline at end of file diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 413d4bae..7499e495 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -9,6 +9,14 @@ This document contains the release notes for the project. .. towncrier release notes start +`1.1.7 `_ - 2024-10-23 +======================================================================================= + +Miscellaneous +^^^^^^^^^^^^^ + +- fix: ensure app.builder.outdir is a Path object `#565 `_ + `1.1.6 `_ - 2024-10-18 ======================================================================================= From 887100524cc758e3fbcf825782637a3bf56de363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADnez?= <28702884+jorgepiloto@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:27:49 +0200 Subject: [PATCH 3/4] fix: changelog action (#563) --- .github/workflows/ci_cd.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index c5608142..38993af5 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -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 From ff89444e4a28145db9545a2fc38ad5d1d1a4702c Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:47:14 +0200 Subject: [PATCH 4/4] fix: cleanup autoapi templates using macros (#556) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Co-authored-by: Jorge Martínez <28702884+jorgepiloto@users.noreply.github.com> Co-authored-by: Jorge Martinez --- doc/changelog.d/556.miscellaneous.md | 1 + .../_templates/autoapi/python/class.rst | 122 ++++++++---------- 2 files changed, 56 insertions(+), 67 deletions(-) create mode 100644 doc/changelog.d/556.miscellaneous.md diff --git a/doc/changelog.d/556.miscellaneous.md b/doc/changelog.d/556.miscellaneous.md new file mode 100644 index 00000000..796b77e8 --- /dev/null +++ b/doc/changelog.d/556.miscellaneous.md @@ -0,0 +1 @@ +fix: cleanup autoapi templates using macros \ No newline at end of file diff --git a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/_templates/autoapi/python/class.rst b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/_templates/autoapi/python/class.rst index 5b4791ec..305a6cb4 100644 --- a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/_templates/autoapi/python/class.rst +++ b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/_templates/autoapi/python/class.rst @@ -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 }}` @@ -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 %} \ No newline at end of file +{% endif %}