https://github.com/projectsyn/component-hub
Project Syn Commodore Component Hub
https://github.com/projectsyn/component-hub
Last synced: 6 months ago
JSON representation
Project Syn Commodore Component Hub
- Host: GitHub
- URL: https://github.com/projectsyn/component-hub
- Owner: projectsyn
- Created: 2021-06-24T09:00:32.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T09:23:50.000Z (over 1 year ago)
- Last Synced: 2024-10-29T09:51:25.754Z (over 1 year ago)
- Language: Python
- Size: 1.12 GB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= Project Syn Commodore Hub Generator
image::https://github.com/projectsyn/component-hub/actions/workflows/hub.yml/badge.svg[Build and Deploy Hub,link=https://github.com/projectsyn/component-hub/actions/workflows/hub.yml]
This project uses the GitHub API to generate an Antora website containing the documentation of all Commodore components and Commodore packages.
== How to Use
. https://github.com/settings/tokens[Create an API token] in GitHub
. Use the `GITHUB_TOKEN=xxx make` command, where `xxx` is the token retrieved in the previous step.
. You can use `make clean` to get rid of the generated website.
== Start hacking on the generator
The generator is implemented in Python.
The project uses [Poetry] to manage the Python virtual environment.
The project sources environment variables from file `.env` if it exists.
=== Setup
The `Makefile` provides a target to setup the poetry environment.
[source,console]
----
make setup
----
=== Run the generator locally
Simply run `make hub` to generate a local copy of the site in `./build/component-hub/_public`
You can run the individual generation steps in isolation:
* `poetry run component-hub generate antora-site` generates the Antora site from the https://github.com/vshn/antora-bootstrap[VSHN Antora Cookiecutter template].
* `poetry run component-hub generate index` generates `docs/modules/ROOT/pages/index.adoc` for the component hub.
* `poetry run component-hub generate nav` generates `docs/modules/ROOT/nav.adoc` for the component hub.
* `poetry run component-hub generate playbook` generates `playbook.yml` for the component hub.
=== Linting and testing
The `Makefile` provides targets for Python linting and testing.
[source,console]
----
make lint
make test
----
The lint and test targets expect that the Poetry environment is already initialized.
The tests require a Github token in environment variable `GITHUB_TOKEN.
The tests source environment variables from file `.env` if it exists.