Skip to content

Commit

Permalink
Add preliminary docs setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rlskoeser committed May 27, 2022
1 parent 36b9a99 commit 53ceca6
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish docs via GitHub Pages
on:
push:
branches:
- main

jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e '.[dev]'
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yml
EXTRA_PACKAGES: build-base
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ If submitting a pull request:
* Follow [PEP8](https://www.python.org/dev/peps/pep-0008/) and [PEP257](https://www.python.org/dev/peps/pep-0257/). These will be required in the CI builds.
* Don't repeat code.
* Cover the code with tests.
* Use [Google style docstrings](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) for any code documentation you add.

## Developing helpers

Expand All @@ -27,3 +28,8 @@ To develop a helper you should follow the documentation [here](https://github.co
* A fixture which demonstrates your use case in the [fixtures directory](https://github.com/iiif-prezi/iiif-prezi3/tree/main/tests/fixtures).

Please submit your pull request to this repository and one of the library committers will merge it into the main if it fits these requirements.


## Docs

To build and view the documentation locally, install requirements with `pip install -e '.[docs]'` and then run `mkdocs serve`.
1 change: 1 addition & 0 deletions docs/README.md
3 changes: 3 additions & 0 deletions docs/code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code reference

::: iiif_prezi3
17 changes: 17 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
site_name: iiif-prezi3

nav:
- 'Getting started':
- 'Using iiifprezi3 without helper methods': 'getting-started-using-iiifprezi3-without-helpermethods.md'
- 'add-reference-to-manifest-inside-a-collection.md'
- Technical:
- 'generate-schema.md'
- 'write-helper-method.md'
- code.md

theme:
name: material

plugins:
- search
- mkdocstrings
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"pydantic"
]

DOCS_REQUIREMENTS = [
"mkdocs",
"mkdocs-material",
"mkdocstrings",
]

# Setting up
setup(
name='iiif-prezi3',
Expand Down Expand Up @@ -46,4 +52,7 @@
url='https://github.com/iiif-prezi/iiif-prezi3',
license='LICENSE',
install_requires=REQUIREMENTS,
extras_require={
"docs": DOCS_REQUIREMENTS,
},
)

0 comments on commit 53ceca6

Please sign in to comment.