-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation #147
Documentation #147
Changes from 3 commits
5dbfc96
27f605b
82e7315
89b0527
457dbf4
4b27576
68dee06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Publish document | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout Repository | ||
- name: Configure Git Credentials | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email github-actions[bot]@users.noreply.github.com | ||
- uses: actions/setup-python@v5 | ||
name: Setup Python | ||
with: | ||
python-version: 3.12 | ||
- name: Set Cache ID | ||
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
name: Restore/Save Cache | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- name: Install MkDocs Dependencies | ||
run: | | ||
pip install mkdocs-material | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would great to put all of this into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the advice! I have updated
|
||
pip install 'mkdocstrings[python]' | ||
- name: Deploy to GitHub Pages | ||
run: mkdocs gh-deploy --force |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ venv/ | |
|
||
# Setuptools scm version | ||
_version.py | ||
|
||
# mkdocs documentation | ||
/site | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we want to remove the leading There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am sorry, but I don't understand which docker container you are mentioning. I do not use docker container for my development environment. I simply followed CONTRIBUTION.md, and it does not have any description for docker. And when I build the document with Is there a way to create the development environment with docker? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,31 @@ To format and lint the codes, | |
tox -e fmt,lint | ||
``` | ||
|
||
## [Optional] Documentation setup | ||
|
||
This repository uses [mkdocs](https://github.com/mkdocs/mkdocs/tree/master) to generate a documentation from python docstring. As long as you write docstrings for your code, the document (API references section) will be automatically updated when the code is merged into `main` branch, so there is no need for you to do anything. | ||
|
||
If you want to manually edit the document, please run the following commands to setup the editing environment. | ||
|
||
```bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we do go the route or scripting and tracking deps in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we have to chose this route. Please check #147 (comment) |
||
pip install mkdocs-material | ||
pip install 'mkdocstrings[python]' | ||
``` | ||
|
||
You can edit the documentation at `docs` folder (i.e. `docs/index.md`) to update the document. | ||
|
||
In order to view the current documentation locally, run the following command. This will host the document at your local server. | ||
|
||
```bash | ||
mkdocs serve | ||
``` | ||
|
||
For more information about mkdocs, please refer to their documentations: | ||
|
||
- mkdocs: https://github.com/mkdocs/mkdocs/tree/master | ||
- mkdocs material (material theme wrapper for mkdocs): https://github.com/squidfunk/mkdocs-material | ||
- mkdocstrings (plugin to automatically generate documentation from docstrings): https://github.com/mkdocstrings/mkdocstrings | ||
|
||
# Your First Contribution | ||
|
||
Would you like to help drive the community forward? We will help you understand the organization of the project and direct you to the best places to get started. You'll be able to pick up issues, write code to fix them, and get your work reviewed and merged. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!-- Auto generate API references with mkdocstrings https://mkdocstrings.github.io/usage/#usage --> | ||
|
||
::: oper8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Oper8 | ||
|
||
Oper8 is a framework for writing kubernetes operators in python. It implements many common patterns used by large cloud applications that are reusable across many operator design patterns ([GitHub](https://github.com/IBM/oper8/tree/main)). | ||
|
||
For API details, please refer to the [API References](API References.md). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
site_name: "oper8" | ||
nav: | ||
- Home: index.md | ||
- API References: API References.md | ||
theme: | ||
name: material | ||
font: | ||
text: IBM Plex Sans | ||
code: IBM Plex Mono | ||
palette: | ||
# Dark Mode | ||
- scheme: slate | ||
toggle: | ||
icon: material/weather-sunny | ||
name: Dark mode | ||
primary: black | ||
accent: deep purple | ||
# Light Mode | ||
- scheme: default | ||
toggle: | ||
icon: material/weather-night | ||
name: Light mode | ||
primary: white | ||
accent: indigo | ||
plugins: | ||
- search | ||
- mkdocstrings: | ||
handlers: | ||
python: | ||
options: | ||
show_submodules: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need
master
in hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Removed with this commit 89b0527.