Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from classPythonAddike/main
Browse files Browse the repository at this point in the history
Added documentation workflow
  • Loading branch information
aescarias committed Sep 25, 2021
2 parents 7bf66fd + 11200ee commit 24bf8b4
Show file tree
Hide file tree
Showing 47 changed files with 271 additions and 19,593 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/sphinx-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish Documentation

env:
GITHUB_ACTOR: Tekgar
GITHUB_REPOSITORY: classPythonAddike/pycordia
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

on:
push:
branches: [ main ]


jobs:

build_sphinx_job:
runs-on: ubuntu-latest
container: debian:buster-slim

steps:

- name: Install packages and clone repo
run: |
set -x
apt-get update
apt-get install -y git
apt-get -y install git python3-pip
git clone "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" .
shell: bash

- name: Install requirements
run: |
python3 -m pip install -r requirements.txt
- name: Build docs with Sphinx
run: |
make generate_docs
rm .github examples pycordia -rf
rm requirements.txt setup.py
cp docs/_build/html . -r
rm docs -rf
mv html docs
mv html-docs/* .
shell: bash

- name: Initialise Git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git init
git remote add deploy "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git checkout -b gh-pages
shell: bash

- name: Push Docs
run: |
touch .nojekyll
git add .
msg="Updating docs for commit ${GITHUB_SHA}"
git commit -am "${msg}"
git push deploy gh-pages --force
shell: bash
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ venv.bak/
# mkdocs documentation
/site

# sphinx docs
/docs/_build

# mypy
.mypy_cache/
.dmypy.json
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_docs:
echo "Generating Docs"
cd docs && sphinx-apidoc -f -o source/ --module-first ../pycordia
cd docs && make html
@echo Generating Docs . . .
@cd docs && sphinx-apidoc -f -o source/ --module-first ../pycordia
@cd docs && make html
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
A work-in-progress Discord API wrapper for Python with a simple gateway and some common events implemented.

While there's currently no documentation available, use the examples for guidance. If you have any questions, feel free to join our [Discord server](https://discord.gg/h5JhXtGfXQ) to follow the changes we make, as well as receive help and talk with others!
If you have any questions, feel free to join our [Discord server](https://discord.gg/h5JhXtGfXQ) to follow the changes we make, as well as receive help and talk with others!

Our examples (and future documentation) assume you're at a level of Python where you can comfortably work with Discord bots.
Our examples, and documentation assume you're at a level of Python where you can comfortably work with Discord bots.

## :gear: Installation
## ⚙️ Installation

Pycordia has been well tested on Python 3.8, however, 3.7 and above are supported.

Expand Down Expand Up @@ -51,7 +51,7 @@ $ python3 -m pip install pycordia-....tar.gz # Alternative; use on MacOS
$ py -3 -m pip install pycordia-....tar.gz # Alternative; use on Windows
```

## :ping_pong: Example of a simple Ping-Pong Bot
## 🏓 Example of a simple Ping-Pong Bot

```py
from pycordia import events, models
Expand Down Expand Up @@ -91,12 +91,12 @@ client.run(os.getenv("DISCORD_TOKEN"))

For all other undocumented events, you'll receive raw JSON data which you'll have to handle yourself.

## :bookmark: Things to do
## 🔖 Things to do

- Improve currently available models
- Add slash commands
- Add all other event wrappers

## :book: Contribute
## 📖 Contribute

Feel free to contribute any bug fixes, new features, or general improvements to the Pycordia project.
Empty file added docs/.nojekyll
Empty file.
Binary file removed docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file removed docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file removed docs/_build/doctrees/source/modules.doctree
Binary file not shown.
Binary file removed docs/_build/doctrees/source/pycordia.doctree
Binary file not shown.
Binary file removed docs/_build/doctrees/source/pycordia.models.doctree
Binary file not shown.
4 changes: 0 additions & 4 deletions docs/_build/html/.buildinfo

This file was deleted.

24 changes: 0 additions & 24 deletions docs/_build/html/_sources/index.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_build/html/_sources/source/modules.rst.txt

This file was deleted.

50 changes: 0 additions & 50 deletions docs/_build/html/_sources/source/pycordia.models.rst.txt

This file was deleted.

66 changes: 0 additions & 66 deletions docs/_build/html/_sources/source/pycordia.rst.txt

This file was deleted.

0 comments on commit 24bf8b4

Please sign in to comment.