|
|
||
|---|---|---|
| .vscode | ||
| data | ||
| timetable-frontend | ||
| .drone.yml | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| LICENSE.md | ||
| README.md | ||
FHNW module Calendar
Updating the displayed calendar (GitLab pages)
Simply replace the PDF file data/klassen.pdf with the newer version and commit it to the
repo. The CI pipeline will handle the updating of the GitLab pages.
Development
You will need to have Python 3.9 or newer with poetry to run the PDF parsing and a recent installation of NodeJS & NPM for building the frontend.
If you are stuck, have a look at the .gitlab-ci.yml to see how the pipeline parses &
builds the frontend.
Dependency installation
For the python dependencies, run poetry install to get the required packages. This will
also create a new virtual environment for you.
To install the frontend dependencies, run cd timetable-frontend && npm install.
Parsing the PDF
Simply run poetry run parse-pdf in the root folder to get a modules.json and
config.json file in the data directory.
Running the frontend
Change into the timetable-frontend directory and run npm run dev for a live
development server. You will also need to copy the data/ folder to
timetable-frontend/public for the server to function correctly. You can do this using
the cmd cp data/* timetable-frontend/public/.
Pre-commit
This repo uses pre-commit to check for common issues. The CI server will check for these on every push, so it's best if you also run pre-commit locally on every commit to avoid failed CI pipelines.
After installing pre-commit simply run pre-commit install to add the hooks to the git
repo. This repo also follows the Conventional Commits
commit style. To check if your commit message conforms to the style, you can add a
pre-commit hook by running: pre-commit install --hook-type commit-msg