-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
3,194 additions
and
1,622 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Deploy Documentation to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
env: | ||
PIPENV_VENV_IN_PROJECT: true | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pipenv | ||
pipenv install -d | ||
sudo apt-get update && sudo apt-get install -y pandoc | ||
- name: Build documentation | ||
run: | | ||
pandoc -s readme.md -o docs/readme.rst | ||
pipenv run sphinx-build -M html docs/ docs/_build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/_build/html |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
footer { | ||
display: none !important; | ||
} |
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,63 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
import os | ||
import sys | ||
import re | ||
sys.path.insert(0, os.path.abspath('../pybela')) | ||
|
||
author = 'Teresa Pelinski' | ||
copyright = '2024' | ||
def get_version_from_setup_py(): | ||
version_pattern = re.compile(r"version=['\"]([^'\"]+)['\"]") | ||
with open('../setup.py', 'r') as f: | ||
setup_py_content = f.read() | ||
match = version_pattern.search(setup_py_content) | ||
if match: | ||
return match.group(1) | ||
raise RuntimeError("Unable to find version string in setup.py") | ||
|
||
release = get_version_from_setup_py() | ||
project = f'pybela {release}' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
extensions = [ | ||
'sphinx.ext.napoleon', 'sphinx.ext.viewcode', 'sphinx_rtd_theme'] | ||
templates_path = ['_templates'] | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '../pybela/utils.py'] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
html_theme = 'sphinx_rtd_theme' | ||
html_css_files = [ | ||
'custom.css', | ||
] | ||
html_static_path = ['_static'] | ||
html_css_files = ['custom.css'] | ||
html_show_sphinx = False | ||
html_show_sourcelink = False | ||
html_sidebars = { | ||
'**': ['globaltoc.html', 'searchbox.html'] | ||
} | ||
html_theme_options = { | ||
'collapse_navigation': False, | ||
'sticky_navigation': True, | ||
'navigation_depth': 4, | ||
'titles_only': False, | ||
'display_version': True, | ||
'prev_next_buttons_location': 'None', | ||
} | ||
|
||
# remove title from readme file to avoid duplication | ||
file_path = 'readme.rst' | ||
|
||
with open(file_path, 'r+') as file: | ||
lines = file.readlines()[2:] # Read lines and skip the first two | ||
file.seek(0) # Move the cursor to the beginning of the file | ||
file.writelines(lines) # Write the modified lines | ||
file.truncate() # Truncate the file to the new size |
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,9 @@ | ||
To build the docs you will need to install `pandoc` to convert the `readme.md` into `rst` (the format used by `sphinx`, the docs builder). You can see the installation instructions [here](https://pandoc.org/installing.html). | ||
|
||
Then you can build the docs with: | ||
|
||
```bash | ||
rm -r _build | ||
pandoc -s ../readme.md -o readme.rst | ||
pipenv run sphinx-build -M html . _build | ||
``` |
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,29 @@ | ||
.. pybela documentation master file, created by | ||
sphinx-quickstart on Tue Aug 6 18:36:50 2024. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
pybela docs | ||
=========== | ||
Welcome to pybela’s documentation! | ||
|
||
.. include:: readme.rst | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Getting started with pybela | ||
:hidden: | ||
|
||
readme | ||
|
||
.. toctree:: | ||
:caption: Module documentation | ||
:maxdepth: 4 | ||
:hidden: | ||
|
||
genindex | ||
modules | ||
|
||
|
||
|
||
|
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,25 @@ | ||
|
||
.. automodule:: pybela.Watcher | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. automodule:: pybela.Streamer | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. automodule:: pybela.Logger | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. automodule:: pybela.Monitor | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. automodule:: pybela.Controller | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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
Oops, something went wrong.