Skip to content

Commit 977268c

Browse files
authored
Merge pull request #476 from NLeSC/456_online_documentation
456-make online documentation optional
2 parents a6e8404 + c25eea6 commit 977268c

8 files changed

+39
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Added
66

7+
* Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476)
78
* Added Python 3.12 support [#356](https://github.com/NLeSC/python-template/issues/356)
89
* Template unit tests for documentation generation, linting and version bumping
910
* Docstring for function

copier.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ AddGitHubActions:
8383
default: "{{ template_profile != 'minimum' }}"
8484
help: GitHub actions to test the package and the documentation
8585

86+
AddOnlineDocumentation:
87+
when: "{{ template_profile == 'ask' }}"
88+
type: bool
89+
default: "{{ template_profile != 'minimum' }}"
90+
help: Online documentation using Read the Docs
91+
8692

8793
# internal fields
8894
_subdirectory: template

template/.github/next_steps/03_readthedocs.md.jinja renamed to template/.github/next_steps/{% if AddOnlineDocumentation %}03_readthedocs.md{% endif %}.jinja

File renamed without changes.

template/.github/workflows/next_steps.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ jobs:
2323
with:
2424
filename: .github/next_steps/02_citation.md
2525
id: citation
26-
- name: Create readthedocs issue
27-
uses: JasonEtco/create-an-issue@v2
28-
env:
29-
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
30-
with:
31-
filename: .github/next_steps/03_readthedocs.md
32-
id: readthedocs
3326
- name: Create Zenodo integration issue
3427
uses: JasonEtco/create-an-issue@v2
3528
env:
@@ -49,7 +42,6 @@ jobs:
4942
echo 'Created issues that must be completed to have fully working Python package:
5043
* Sonarcloud integration ${{ '{{ ' -}} steps.sonarcloud.outputs.url }}
5144
* Zenodo integration ${{ '{{ ' -}} steps.zenodo.outputs.url }}
52-
* Read the Docs instructions ${{ '{{ ' -}} steps.readthedocs.outputs.url }}
5345
* Citation data ${{ '{{ ' -}} steps.citation.outputs.url }}
5446
* Linting fixes ${{ '{{ ' -}} steps.linting.outputs.url }}'
5547
- name: Cleanup files needed to create next steps issues
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on: [push]
2+
permissions:
3+
contents: write
4+
issues: write
5+
name: Create an issue for online documentation
6+
jobs:
7+
next_steps:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Create readthedocs issue
12+
uses: JasonEtco/create-an-issue@v2
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
with:
16+
filename: .github/next_steps/03_readthedocs.md
17+
id: readthedocs
18+
- name: List created issues
19+
run: |
20+
echo 'Created issues that must be completed to have fully working Python package:
21+
* Read the Docs instructions ${{ steps.readthedocs.outputs.url }}'
22+
- name: Cleanup files needed to create next steps issues
23+
run: |
24+
git config --global user.name 'NLeSC Python template'
25+
git config --global user.email '[email protected]'
26+
git rm .github/workflows/next_steps_online_documentation.yml
27+
git rm -r .github/next_steps
28+
git commit -am "Cleanup automated next steps issue generator"
29+
git push

template/README.md.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
| **Other best practices** |   |
1414
| Static analysis | [![workflow scq badge](https://sonarcloud.io/api/project_badges/measure?project={{github_organization}}_{{package_name}}&metric=alert_status)](https://sonarcloud.io/dashboard?id={{github_organization}}_{{package_name}}) |
1515
| Coverage | [![workflow scc badge](https://sonarcloud.io/api/project_badges/measure?project={{github_organization}}_{{package_name}}&metric=coverage)](https://sonarcloud.io/dashboard?id={{github_organization}}_{{package_name}}) |
16+
{% if AddOnlineDocumentation -%}
1617
| Documentation | [![Documentation Status](https://readthedocs.org/projects/{{package_name}}/badge/?version=latest)](https://{{package_name}}.readthedocs.io/en/latest/?badge=latest) |
18+
{%- endif -%}
1719
| **GitHub Actions** |   |
1820
| Build | [![build]({{repository_url}}/actions/workflows/build.yml/badge.svg)]({{repository_url}}/actions/workflows/build.yml) |
1921
| Citation data consistency | [![cffconvert]({{repository_url}}/actions/workflows/cffconvert.yml/badge.svg)]({{repository_url}}/actions/workflows/cffconvert.yml) |

template/project_setup.md.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ help you decide which tool to use for packaging.
5959
- The documentation is set up with the ReadTheDocs Sphinx theme.
6060
- Check out its [configuration options](https://sphinx-rtd-theme.readthedocs.io/en/latest/).
6161
- [AutoAPI](https://sphinx-autoapi.readthedocs.io/) is used to generate documentation for the package Python objects.
62-
- `.readthedocs.yaml` is the ReadTheDocs configuration file. When ReadTheDocs is building the documentation this package and its development dependencies are installed so the API reference can be rendered.
62+
{% if AddOnlineDocumentation %}- `.readthedocs.yaml` is the ReadTheDocs configuration file. When ReadTheDocs is building the documentation this package and its development dependencies are installed so the API reference can be rendered.{% endif -%}
6363
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/language_guides/python?id=writingdocumentation)
6464

6565
## Coding style conventions and code quality

template/.readthedocs.yaml renamed to template/{% if AddOnlineDocumentation %}.readthedocs.yaml{% endif %}

File renamed without changes.

0 commit comments

Comments
 (0)