Skip to content

Commit

Permalink
Remove Sphinx for good
Browse files Browse the repository at this point in the history
  • Loading branch information
pabera committed Nov 11, 2023
1 parent a707a24 commit 3b23e7c
Show file tree
Hide file tree
Showing 71 changed files with 11 additions and 3,739 deletions.
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ filename = *.py,*.py.*
extend-exclude =
# Ignore all scratch development directories
scratch*,
# The conf file is mostly autogenerated, ignore it
docs/sphinx/conf.py,
# Ignore dirs and files that have not been ported yet
*/jukebox/NvManager.py
# ignore GitHub Codespaces
Expand Down
13 changes: 1 addition & 12 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,7 @@ if [[ -n $PY_FILES ]]; then
echo "Flake8 return code: $flake8_code"
fi

DOC_FILES="$(git diff --diff-filter=d --staged --name-only -- docs/sphinx/*)"
sphinx_code=0
if [[ -n $DOC_FILES || -n $PY_FILES ]]; then
echo -e "\n**************************************************************"
echo -e "Files for documentation modified. Testing re-build of docs ... \n"
echo -e "**************************************************************\n"
./run_sphinx.sh -c
sphinx_code=$?
echo "Sphinx return code: $sphinx_code"
fi

code=$(( flake8_code + sphinx_code ))
code=$(( flake8_code ))

if [[ code -gt 0 ]]; then
echo -e "\n**************************************************************"
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/pythonpackage_future3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ on:
paths:
- '**.py'
- '**.py.*'
- 'docs/sphinx/**'
pull_request:
branches:
- 'future3/**'
paths:
- '**.py'
- '**.py.*'
- 'docs/sphinx/**'

jobs:
build:
Expand All @@ -40,9 +38,6 @@ jobs:
pip3 install spidev
pip3 install -r requirements.txt
# For operation of the Jukebox, ZMQ must be compiled from sources due to Websocket support
# When just building the docs, the regular ZMQ package is sufficient
pip3 install -r docs/sphinx/requirements_pyzmq.txt
pip3 install -r docs/sphinx/requirements.txt
# Also install all optional dependencies
pip3 install -r src/jukebox/components/rfid/hardware/fake_reader_gui/requirements.txt
pip3 install -r src/jukebox/components/rfid/hardware/pn532_i2c_py532/requirements.txt
Expand All @@ -53,9 +48,3 @@ jobs:
pip3 install flake8
# Stop the build if linting fails
./run_flake8.sh
- name: Build the docs
working-directory: ./docs/sphinx
run: |
# Stop the build if documentation cannot be built
# Treat all warnings as errors
sphinx-build -W --keep-going -T -a -E -b html . _build
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
/shared/*.*
/shared/*

# Documentation builder
/docs/sphinx/_build/

# Application
/src/cli_client/pbc

Expand Down
28 changes: 0 additions & 28 deletions .readthedocs.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ The Jukebox core app is written entirely in Python. Therefore, we follow the [Py

* **Documentation**
* You are expected to write some Documentation. It's easy. **Very** easy actually with [Python Docstrings](https://www.geeksforgeeks.org/python-docstrings/)
* If you dare, you may add the python documentation reference to the Sphinx documentation build. But we are also ok with doing that for you

# Structure of files and folders

Expand All @@ -38,8 +37,6 @@ Inside the root folder or the repo, these folders are important:
* contains the Python packages that are loaded using the plugin interface
* `src/webapp`
* contains the Web Interface
* `src/docs/sphinx`
* contains the documentation sources and build flow using Sphinx

All folders on all hierarchy levels starting with `scratch*` are ignored by git and flake8. These are intended
as local, temporary scratch areas.
Expand Down Expand Up @@ -132,18 +129,6 @@ cd /home/pi/RPi-Jukebox-RFID
If you are convinced some issue should not apply to your case or would require extensive re-coding, that could be OK.
Let us know in the pull request - we will look at it.
### Documentation
When adding or improving documentation, build the documentation and look at it locally.
If you are contributing to existing Python modules, be aware that these are already included in the documentation flow.
Also run through this step in this case! Fix all warnings!
~~~bash
$ cd /home/pi/RPi-Jukebox-RFID/
$ ./run_sphinx.sh
# open and check the result: 'file:///path/to/RPi-Jukebox-RFID/docs/sphinx/_build/html/index.html'
~~~
### Tests
Tests are very few at the moment, but it cannot hurt to run them. If you have tests for your new modules, please add
Expand Down
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,7 @@ project check out the [documentation of Version 2](<https://github.com/MiczFlor/

## Where are the Help pages?

### Online

Read the documentation at [Readthedocs.io](https://rpi-jukebox-rfid.readthedocs.io/en/latest/)

### Local

Alternatively, build the help locally:

~~~bash
cd docs/sphinx
make
~~~

Then navigate your browser to

~~~bash
file:///path/to/RPi-Jukebox-RFID/docs/sphinx/_build/html/docs/index.html
~~~
The documentation can be found [here](documentation)

## Installation?

Expand Down
3 changes: 0 additions & 3 deletions docker/build-documentation.Dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions docker/docker-compose.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,3 @@ services:
- ../shared:/home/pi/RPi-Jukebox-RFID/shared
- ./config/docker.pulse.mpd.conf:/home/pi/.config/mpd/mpd.conf
- $XDG_RUNTIME_DIR/pulse/native:/tmp/pulse-sock

documentation:
build:
args:
- UID=${UID:-1000}
- USER=pi
- HOME=/home/pi
environment:
- PULSE_SERVER=unix:/tmp/pulse-sock
volumes:
- ../shared:/home/pi/RPi-Jukebox-RFID/shared
- ./config/docker.pulse.mpd.conf:/home/pi/.config/mpd/mpd.conf
- $XDG_RUNTIME_DIR/pulse/native:/tmp/pulse-sock
5 changes: 0 additions & 5 deletions docker/docker-compose.mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ services:
volumes:
- ~/.config/pulse:/root/.config/pulse
- /usr/local/Cellar/pulseaudio/14.2/etc/pulse:/etc/pulse

documentation:
volumes:
- ~/.config/pulse:/root/.config/pulse
- /usr/local/Cellar/pulseaudio/14.2/etc/pulse:/etc/pulse
17 changes: 0 additions & 17 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,6 @@ services:
- ./config/docker.pulse.mpd.conf:/root/.config/mpd/mpd.conf
command: python3 run_jukebox.py

documentation:
profiles: ["documentation"]
build:
args:
- UID=0
- USER=root
- HOME=/root
context: ../
dockerfile: ./docker/build-documentation.Dockerfile
container_name: documentation
image: phoniebox/build-documentation
tty: true
volumes:
- ../shared:/root/RPi-Jukebox-RFID/shared
- ./config/docker.pulse.mpd.conf:/root/.config/mpd/mpd.conf
command: python3 ../../run_sphinx.py

webapp:
build:
context: ../
Expand Down
2 changes: 1 addition & 1 deletion docker/webapp.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine
FROM node:18-bullseye-slim

USER node
RUN mkdir -p /home/node/webapp
Expand Down
20 changes: 0 additions & 20 deletions documentation/content/developers/coreapps.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,3 @@ The list of available commands is fetched from the running Jukebox service.
### run_publicity_sniffer.py

A command line tool that monitors all messages being sent out from the Jukebox via the publishing interface. Received messages are printed in the console. Mainly used for debugging.

### run_sphinx.sh (Legacy: TO BE REMOVED)

This command rebuilds the documentation using a Sphinx flow, located in
the main directory.

The documentation is built partially from auto-generated RST-files. Thee
files contain the
`userguide/rpc_command_reference:RPC Command Reference`{.interpreted-text
role="ref"} and
`userguide/rpc_command_alias_reference:RPC Command Alias Reference`{.interpreted-text
role="ref"}.

``` bash
run_jukebox.py -a
```

The above command regenerate these RST files. This only needs to be done
when the RPC call references need to be updated within the documentation
flow.
4 changes: 1 addition & 3 deletions documentation/content/developers/rfid/template_reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ components/rfid/hardware/awesome_reader/
+- README.rst <-- The Readme
```

The module documentation must go into a separate file so we can import
it into the Sphinx document generation flow without loading the Python
module.
The module documentation must go into a separate file, called README.ME.

## Conventions

Expand Down
17 changes: 0 additions & 17 deletions documentation/sphinx/_templates/footer.html

This file was deleted.

20 changes: 0 additions & 20 deletions documentation/sphinx/api/api.rst

This file was deleted.

9 changes: 0 additions & 9 deletions documentation/sphinx/api/callingback.rst

This file was deleted.

5 changes: 0 additions & 5 deletions documentation/sphinx/api/cfghandler.rst

This file was deleted.

19 changes: 0 additions & 19 deletions documentation/sphinx/api/controls.rst

This file was deleted.

45 changes: 0 additions & 45 deletions documentation/sphinx/api/gpioz/connector.rst

This file was deleted.

13 changes: 0 additions & 13 deletions documentation/sphinx/api/gpioz/converter.rst

This file was deleted.

Loading

0 comments on commit 3b23e7c

Please sign in to comment.