Skip to content

Commit 4e50a54

Browse files
authored
Embedd examples inside documentation (#84)
* Adding server run to the docs * Allowing examples rendering * Always upload server docs * Include examples in docs * Adding missing README * Rename Readme.txt to README.txt * Rename Readme.txt to README.txt * Rename Readme.txt to README.txt * Rename Readme.txt to README.txt * Rename Readme.txt to README.txt * Rename Readme.txt to README.txt * Rename Readme.txt to README.txt * Rename Readme.txt to README.txt * Missing imports * Ignoring solver examples folder
1 parent 591ffc2 commit 4e50a54

File tree

13 files changed

+26
-5
lines changed

13 files changed

+26
-5
lines changed

.github/workflows/ci_cd.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ jobs:
4949
pip install --upgrade build
5050
pip install .[doc]
5151
52+
- name: Run server
53+
run: |
54+
cd src/ansys/dyna/core/pre/Server
55+
python kwserver.py > server_output_docs.txt &
56+
sleep 10
57+
cd -
58+
5259
- name: Build the documentation
5360
run: |
5461
xvfb-run make -C doc html
@@ -60,6 +67,13 @@ jobs:
6067
path: doc/_build/html
6168
retention-days: 7
6269

70+
- name: Upload the server logs
71+
if: always()
72+
uses: actions/upload-artifact@v3
73+
with:
74+
name: server-logs-docs
75+
path: src/ansys/dyna/core/pre/Server/server_output_docs.txt
76+
6377
style:
6478
name: Code style
6579
runs-on: ubuntu-latest

doc/source/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pyvista
77
from ansys_sphinx_theme import pyansys_logo_black, ansys_favicon
88
from sphinx.builders.latex import LaTeXBuilder
9+
from sphinx_gallery.sorting import FileNameSortKey
910

1011
from ansys.dyna.core import __version__
1112

@@ -51,8 +52,7 @@ def get_version_match(semver):
5152
# convert rst to md for ipynb
5253
"pypandoc": True,
5354
# path to your examples scripts
54-
# "examples_dirs": ["../../examples/"],
55-
"examples_dirs": [],
55+
"examples_dirs": ["../../examples/"],
5656
# path where to save gallery generated examples
5757
"gallery_dirs": ["examples"],
5858
# Patter to search for examples files
@@ -62,11 +62,11 @@ def get_version_match(semver):
6262
# Remove the "Download all examples" button from the top level gallery
6363
"download_all_examples": False,
6464
# Sort gallery examples by file name instead of number of lines (default)
65-
#"within_subsection_order": FileNameSortKey,
65+
"within_subsection_order": FileNameSortKey,
6666
# directory where function granular galleries are stored
6767
"backreferences_dir": None,
6868
# Modules for which function level galleries are created. In
69-
"doc_module": "ansys-mapdl-core",
69+
"doc_module": "ansys-dyna-core",
7070
"image_scrapers": ("pyvista", "matplotlib"),
7171
"thumbnail_size": (350, 350),
7272
# 'first_notebook_cell': ("%matplotlib inline\n"

doc/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ PyDyna documentation 0.0.1
1010
Resources/User_Guide
1111
API/index
1212
Resources/Contributing
13+
examples/index
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)