diff --git a/.github/workflows/publish-cpp-api-docs.yml b/.github/workflows/publish-cpp-api-docs.yml new file mode 100644 index 0000000000..91d681eeb8 --- /dev/null +++ b/.github/workflows/publish-cpp-api-docs.yml @@ -0,0 +1,87 @@ +# This file was generated with the assistance of an AI coding tool. + +name: Publish C++ API documentation + +on: + push: + branches: + - v0.9.0 + paths: + - '.github/workflows/publish-cpp-api-docs.yml' + - 'docs/cpp-api/**' + - 'src/ifcgeom/**' + - 'src/ifcparse/**' + - 'src/serializers/**' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: publish-cpp-api-docs + cancel-in-progress: false + +jobs: + publish: + if: github.repository == 'IfcOpenShell/IfcOpenShell' + runs-on: ubuntu-24.04 + + steps: + - name: Checkout IfcOpenShell + uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: '3.10' + + - name: Install documentation dependencies + run: | + sudo apt-get update + sudo apt-get install --yes doxygen graphviz + python -m pip install --requirement docs/cpp-api/requirements.txt + + - name: Build C++ API documentation + working-directory: docs/cpp-api + run: | + export PROJECT_NUMBER="$(git rev-parse --short HEAD)" + python -m sphinx -M html . output -W --keep-going + + - name: Checkout documentation repository + uses: actions/checkout@v7 + with: + repository: IfcOpenShell/cpp_docs + ref: master + path: published-docs + token: ${{ secrets.BUILD_REPO_TOKEN }} + + - name: Replace published documentation + run: | + publish_tree="${RUNNER_TEMP}/published-docs-tree" + mkdir -p "${publish_tree}/v0.9.0-latest" + + rsync --archive docs/cpp-api/output/html/ "${publish_tree}/v0.9.0-latest/" + touch "${publish_tree}/.nojekyll" + + if [[ -f published-docs/CNAME ]]; then + cp published-docs/CNAME "${publish_tree}/CNAME" + fi + + rsync --archive --delete --exclude='.git/' "${publish_tree}/" published-docs/ + + - name: Commit and push if changed + working-directory: published-docs + env: + SOURCE_SHA: ${{ github.sha }} + run: | + git config user.name 'IfcOpenBot' + git config user.email 'IfcOpenBot@users.noreply.github.com' + + git add --all + if git diff --cached --quiet; then + echo "No changes to commit" + exit 0 + fi + + git commit -m "Update C++ API docs from ${SOURCE_SHA:0:7}" + git push origin master diff --git a/docs/cpp-api/Doxyfile b/docs/cpp-api/Doxyfile index 0264b2e811..1c700b4df8 100644 --- a/docs/cpp-api/Doxyfile +++ b/docs/cpp-api/Doxyfile @@ -1031,7 +1031,8 @@ EXCLUDE_SYMBOLS = "ifcopenshell::geom::opaque_number::*" \ "util::string_buffer::*_item" \ util::string_buffer::item \ ifcopenshell::geom::layer_filter::wildcards_match \ - ifcopenshell::paged_file_impl::Entry \ + ifcopenshell::paged_file_impl::entry \ + ifcopenshell::token \ attribute_value::pointer_type \ INCLUDE_PARENT_PARENT_DIR \ POSTFIX_SCHEMA_ \ @@ -2376,8 +2377,8 @@ PREDEFINED = IFC_PARSE_API= \ SERIALIZERS_API= \ "POSTFIX_SCHEMA(name)=name##_Schema" \ "Handle(name):=opencascade::handle" \ - Kernel_=Kernel \ - SimpleKernel_=SimpleKernel \ + kernel_=kernel \ + Simplekernel_=Simplekernel \ inline= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this @@ -2387,7 +2388,7 @@ PREDEFINED = IFC_PARSE_API= \ # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = Kernel_ \ +EXPAND_AS_DEFINED = kernel_ \ cgal_shape \ cgal_kernel \ cgal_placement \ diff --git a/docs/cpp-api/conf.py b/docs/cpp-api/conf.py new file mode 100644 index 0000000000..bf96df0cc5 --- /dev/null +++ b/docs/cpp-api/conf.py @@ -0,0 +1,59 @@ +# This file was generated with the assistance of an AI coding tool. + +import warnings +from pathlib import Path +from shutil import rmtree + +from sphinx.deprecation import RemovedInSphinx90Warning + +warnings.filterwarnings("ignore", category=RemovedInSphinx90Warning, module=r"exhale\.configs") + +generated_directories = ( + Path(__file__).parent / "output" / "api", + Path(__file__).parent / "output" / "doxygen", +) +for generated_directory in generated_directories: + if generated_directory.is_dir(): + rmtree(generated_directory) + +project = "IfcOpenShell" +copyright = "2020, IfcOpenShell" + +extensions = [ + "breathe", + "exhale", +] + +primary_domain = "cpp" +highlight_language = "cpp" +html_theme = "alabaster" + +breathe_projects = { + "IfcOpenShell": "./output/doxygen/xml", +} +breathe_default_project = "IfcOpenShell" + +exhale_args = { + "containmentFolder": "./output/api", + "rootFileName": "library_root.rst", + "rootFileTitle": "IfcOpenShell C++ API", + "doxygenStripFromPath": "../..", + "createTreeView": False, + "exhaleExecutesDoxygen": True, + "exhaleUseDoxyfile": True, +} + +cpp_id_attributes = [ + "IFC_PARSE_API", + "IFC_SCHEMA_API", + "IFC_GEOM_API", + "IFC_GEOMLIBRARY_API", + "IFC_GEOMSERIALIZATION_API", + "SERIALIZERS_API", +] + +exclude_patterns = [ + "output/doctrees", + "output/doxygen", + "output/html", +] diff --git a/docs/cpp-api/index.rst b/docs/cpp-api/index.rst new file mode 100644 index 0000000000..72aa1b31d7 --- /dev/null +++ b/docs/cpp-api/index.rst @@ -0,0 +1,9 @@ +.. This file was generated with the assistance of an AI coding tool. + +IfcOpenShell C++ API +==================== + +.. toctree:: + :maxdepth: 2 + + output/api/library_root diff --git a/docs/cpp-api/requirements.txt b/docs/cpp-api/requirements.txt new file mode 100644 index 0000000000..08ad09bbdb --- /dev/null +++ b/docs/cpp-api/requirements.txt @@ -0,0 +1,5 @@ +# This file was generated with the assistance of an AI coding tool. + +Sphinx==8.1.3 +breathe==4.36.0 +exhale==0.3.7 diff --git a/src/bonsai/bonsai/tool/blender.py b/src/bonsai/bonsai/tool/blender.py index 5d67bed82b..c25b104680 100644 --- a/src/bonsai/bonsai/tool/blender.py +++ b/src/bonsai/bonsai/tool/blender.py @@ -30,6 +30,7 @@ import sys import tempfile import traceback import types +import re from collections.abc import ( Callable, Generator,