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

WIP #263

Closed
wants to merge 6 commits into from
Closed

WIP #263

Show file tree
Hide file tree
Changes from all commits
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
22 changes: 10 additions & 12 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
PYAEDT_NON_GRAPHICAL: '1'
# To keep as it impacts pyaedt behavior
PYAEDT_DOC_GENERATION: '1'
SPHINXBUILD_HTML_AND_PDF_WORKFLOW: '1'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -41,6 +42,8 @@ jobs:
doc-build:
name: Build documentation
runs-on: [self-hosted, Windows, pyaedt-examples]
env:
FORCE_COLOR: '1'
steps:
- uses: actions/checkout@v4

Expand All @@ -62,13 +65,11 @@ jobs:
.venv\Scripts\Activate.ps1
pip install --no-cache-dir -r requirements/requirements_doc.txt

# Use environment variable speed up build for PDF pages
- name: Create HTML documentation
env:
SPHINXBUILD_HTML_AND_PDF_WORKFLOW: "1"
run: |
.venv\Scripts\Activate.ps1
. .\doc\make.bat html --color
. .\doc\make.bat pdf

# NOTE: Ugly HTML checking but redirecting errors with our docs either leads
# to errors in powershell or workflows getting stuck in Github CICD.
Expand All @@ -81,22 +82,19 @@ jobs:
exit 1
}

- name: Create HTML documentation
run: |
.venv\Scripts\Activate.ps1
. .\doc\make.bat html --color
. .\doc\make.bat pdf

- name: Upload HTML documentation artifact
uses: actions/upload-artifact@v4
with:
name: documentation-html
path: doc/_build/html
retention-days: 7

# Use environment variable to remove the doctree after the build of PDF pages
# Keeping doctree could cause an issue, see https://github.com/ansys/pyaedt/pull/3844/files
- name: Create PDF documentation
env:
SPHINXBUILD_HTML_AND_PDF_WORKFLOW: "1"
run: |
.venv\Scripts\Activate.ps1
. .\doc\make.bat pdf

- name: Upload PDF documentation artifact
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pushd %~dp0
REM Command file for Sphinx documentation

if "%SPHINXOPTS%" == "" (
set SPHINXOPTS=-j auto --color
set SPHINXOPTS=-j auto --color -W -v
)
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
Expand Down
19 changes: 11 additions & 8 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def copy_examples_structure(app: Sphinx, config: Config):
logger.info(f"Copy performed.")


def copy_script_examples(app: Sphinx, config: Config):
def copy_script_examples(app: Sphinx, exception: Exception | None):
"""Copy root directory examples script into Sphinx application out directory.

This is required to allow users to download python scripts in the admonition.
Expand All @@ -125,15 +125,18 @@ def copy_script_examples(app: Sphinx, config: Config):
config : sphinx.config.Config
Configuration file abstraction.
"""
destination_dir = Path(app.outdir, "examples").resolve()
logger.info(f"Copying script examples into out directory {destination_dir}.")
if exception is None:
destination_dir = Path(app.outdir, "examples").resolve()
logger.info(f"Copying script examples into out directory {destination_dir}.")

EXAMPLES = EXAMPLES_DIRECTORY.glob("**/*.py")
for example in EXAMPLES:
example_path = str(example).split("examples" + os.sep)[-1]
shutil.copyfile(example, str(destination_dir / example_path))
EXAMPLES = EXAMPLES_DIRECTORY.glob("**/*.py")
for example in EXAMPLES:
example_path = str(example).split("examples" + os.sep)[-1]
shutil.copyfile(example, str(destination_dir / example_path))

logger.info(f"Copy performed.")
logger.info(f"Copy performed.")
else:
logger.warning(f"An exception occured. Skipping copy_script_examples.")


def adjust_image_path(app: Sphinx, docname, source):
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This repository contains end-to-end embedding examples that demonstrate how to u
:link-type: doc

.. image:: examples/electrothermal/_static/icepak_logo.png
:alt: Icepak
:alt: icepak
:width: 250px
:height: 200px
:align: center
Expand Down
Binary file removed examples/aedt/_static/aedt.png
Binary file not shown.
122 changes: 0 additions & 122 deletions examples/aedt/circuit/index.rst

This file was deleted.

82 changes: 0 additions & 82 deletions examples/aedt/emit/index.rst

This file was deleted.

Loading
Loading