Skip to content

Commit ca03563

Browse files
authored
DOC: add more examples and automate their rendering (#109)
1 parent 43c72ab commit ca03563

30 files changed

+594
-253
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
max-line-length = 88
33
ignore = E501
4-
extend-ignore = E203
4+
extend-ignore = E203, W503

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,5 @@ cython_debug/
162162

163163
# End of https://www.toptal.com/developers/gitignore/api/python
164164

165-
# Ignore baked output cookies from debugging
166-
output/
165+
# Ignore rendered examples
166+
*-rendered-example.yml

doc-style/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ inputs:
1010
token:
1111
description: "Required token for Vale commenter."
1212
required: true
13+
type: string
1314

1415
runs:
1516
using: "composite"

doc/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ help:
1919
%: Makefile
2020
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2121

22+
clean:
23+
rm -rf $(BUILDDIR)
24+
rm -rf $(SOURCEDIR)/**/*-rendered-example.yml
25+
2226
# Customized pdf fov svg format images
2327
pdf:
2428
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
build-c-extension:
2+
name: "Build a C-extension library"
3+
runs-on: ${{ '{{ matrix.os }}' }}
4+
strategy:
5+
matrix:
6+
os: [ubuntu-latest, windows-latest, macos-11]
7+
steps:
8+
- name: "Build a C-extension library wheel artifacts"
9+
uses: pyansys/actions/build-ci-library@{{ branch }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build-library:
2+
name: "Build library basic example"
3+
runs-on: ubuntu-latest
4+
steps:
5+
- name: "Build library source and wheel artifacts"
6+
uses: pyansys/actions/build-library@{{ branch }}
7+
with:
8+
library-name: "ansys-<product>-<library>"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
build-wheelhouse:
2+
name: "Build wheelhouse for latest Python versions"
3+
runs-on: ${{ '{{ matrix.os }}' }}
4+
strategy:
5+
matrix:
6+
os: [ubuntu-latest, windows-latest]
7+
python-version: ['3.7', '3.8', '3.9', '3.10']
8+
steps:
9+
- name: "Build a wheelhouse of the Python library"
10+
uses: pyansys/actions/build-wheelhouse@{{ branch }}
11+
with:
12+
library-name: "<ansys-product-library>"
13+
library-namespace: "<ansys.product.library>"
14+
operating-system: ${{ '{{ matrix.os }}' }}
15+
python-version: ${{ '{{ matrix.python-version }}' }}

doc/source/build-actions/index.rst

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,19 @@ This action builds source and wheel artifacts for a Python library.
1313

1414
{{ inputs_table }}
1515

16+
Examples
17+
++++++++
1618

17-
Here is a code sample for using this action:
19+
{% for filename, title in examples %}
20+
.. dropdown:: {{ title }}
21+
:animate: fade-in
1822

19-
.. code-block:: yaml
23+
.. literalinclude:: examples/{{ filename }}
24+
:language: yaml
2025

21-
build-library:
22-
name: Build library
23-
runs-on: ubuntu-latest
24-
steps:
25-
- name: "Build library source and wheel artifacts"
26-
uses: pyansys/actions/build-library@main
27-
with:
28-
library-name: "ansys-<product>-<library>"
26+
{% endfor %}
2927

3028

31-
here is a code for using this action
32-
3329
Build wheelhouse action
3430
-----------------------
3531
This action builds the wheelhouse for a Python library and publishes them as
@@ -39,25 +35,17 @@ artifacts.
3935

4036
{{ inputs_table }}
4137

42-
Here is a code sample for using this action:
38+
Examples
39+
++++++++
40+
41+
{% for filename, title in examples %}
42+
.. dropdown:: {{ title }}
43+
:animate: fade-in
4344

44-
.. code-block:: yaml
45+
.. literalinclude:: examples/{{ filename }}
46+
:language: yaml
4547

46-
build-wheelhouse:
47-
name: Build the wheelhouse of the Python library
48-
runs-on: ${{ matrix.os }}
49-
strategy:
50-
matrix:
51-
os: [ubuntu-latest, windows-latest]
52-
python-version: ['3.7', '3.8', '3.9', '3.10']
53-
steps:
54-
- name: "Build a wheelhouse of the Python library"
55-
uses: pyansys/actions/build-wheelhouse@main
56-
with:
57-
library-name: "<ansys-product-library>"
58-
library-namespace: "<ansys.product.library>"
59-
operating-system: ${{ matrix.os }}
60-
python-version: ${{ matrix.python-version }}
48+
{% endfor %}
6149

6250

6351
Build C-extension library action
@@ -69,16 +57,15 @@ C-extension.
6957

7058
{{ inputs_table }}
7159

60+
Examples
61+
++++++++
62+
63+
{% for filename, title in examples %}
64+
.. dropdown:: {{ title }}
65+
:animate: fade-in
7266

73-
.. code-block:: yaml
67+
.. literalinclude:: examples/{{ filename }}
68+
:language: yaml
7469

75-
build-c-extension:
76-
name: Build a C-extension library
77-
runs-on: ${{ matrix.os }}
78-
strategy:
79-
matrix:
80-
os: [ubuntu-latest, windows-latest, macos-11]
81-
steps:
82-
- name: "Build a C-extension library wheel artifacts"
83-
uses: pyansys/actions/build-ci-library@main
70+
{% endfor %}
8471

0 commit comments

Comments
 (0)