-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sc/187-update-docs-recommendations
- Loading branch information
Showing
10 changed files
with
180 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache tox | ||
uses: actions/cache@v4 | ||
with: | ||
path: .tox | ||
key: tox-${{ '{{' }} hashFiles('pyproject.toml') {{ '}}' }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
cache: "pip" | ||
cache-dependency-path: "pyproject.toml" | ||
|
||
- name: Install tox | ||
run: python -m pip install tox | ||
- name: Build HTML documentation with tox | ||
run: tox -e docs | ||
{%- if cookiecutter.deploy_docs_to_github_pages %} | ||
|
||
# Automatically deploy documentation to a GitHub Pages website on pushing to main. | ||
# Requires configuring the repository to deploy GitHub pages from a branch | ||
# gh-pages (https://tinyurl.com/gh-pages-from-branch), which will be created the | ||
# first time this workflow step is run. | ||
- name: Publish documentation on GitHub pages | ||
if: success() && github.event_name != 'pull_request' | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ '{{' }} secrets.GITHUB_TOKEN {{ '}}' }} | ||
publish_dir: site | ||
publish_branch: gh-pages | ||
user_name: "github-actions[bot]" | ||
user_email: "github-actions[bot]@users.noreply.github.com" | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{! | ||
include-markdown "../LICENSE.md" | ||
!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# API reference | ||
|
||
::: {{cookiecutter.package_name}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{! | ||
include-markdown "../README.md" | ||
rewrite-relative-urls=false | ||
!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
site_name: "{{cookiecutter.project_name}}" | ||
site_description: "Documentation website for {{cookiecutter.project_name}}" | ||
site_author: "{{cookiecutter.author_given_names}} {{cookiecutter.author_family_names}}" | ||
copyright: "Copyright © {% now 'utc', '%Y' %} {{cookiecutter.author_given_names}} {{cookiecutter.author_family_names}}" | ||
repo_url: "https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/" | ||
repo_name: "{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}" | ||
edit_uri: edit/main/docs/ | ||
|
||
validation: | ||
omitted_files: warn | ||
absolute_links: warn | ||
unrecognized_links: warn | ||
|
||
theme: | ||
name: "material" | ||
features: | ||
- content.action.edit | ||
palette: | ||
- media: "(prefers-color-scheme)" | ||
toggle: | ||
icon: material/brightness-auto | ||
name: Switch to light mode | ||
- media: "(prefers-color-scheme: light)" | ||
scheme: default | ||
toggle: | ||
icon: material/brightness-7 | ||
name: Switch to dark mode | ||
- media: "(prefers-color-scheme: dark)" | ||
scheme: slate | ||
toggle: | ||
icon: material/brightness-4 | ||
name: Switch to system preference | ||
icon: | ||
repo: fontawesome/brands/github | ||
|
||
nav: | ||
- Overview: index.md | ||
- API reference: api.md | ||
- License: LICENSE.md | ||
|
||
markdown_extensions: | ||
- pymdownx.tasklist | ||
|
||
plugins: | ||
- search | ||
- mkdocstrings: | ||
default_handler: python | ||
handlers: | ||
python: | ||
docstring_style: google | ||
import: | ||
- "https://docs.python.org/3/objects.inv" | ||
paths: [src] | ||
- include-markdown: | ||
opening_tag: "{!" | ||
closing_tag: "!}" | ||
|
||
extra: | ||
social: | ||
- icon: fontawesome/brands/github | ||
link: "https://github.com/{{cookiecutter.github_username}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
{{cookiecutter.project_slug}}/src/{{cookiecutter.package_name}}/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
"""{{cookiecutter.package_name}} package.""" | ||
from ._version import __version__ # noqa: F401 | ||
|
||
|
||
def example_function(argument: str, keyword_argument: str = "default") -> str: | ||
""" | ||
Concatenate string arguments - an example function docstring. | ||
Args: | ||
argument: An argument. | ||
keyword_argument: A keyword argument with a default value. | ||
Returns: | ||
The concatenation of `argument` and `keyword_argument`. | ||
""" | ||
return argument + keyword_argument |