diff --git a/.github/workflows/publish_docs_cloudflare.yml b/.github/workflows/publish_docs_cloudflare.yml new file mode 100644 index 0000000..7b3b1f4 --- /dev/null +++ b/.github/workflows/publish_docs_cloudflare.yml @@ -0,0 +1,47 @@ +env: + SUBFOLDER: docs_website + +name: Publish Docs to docs.velconnect.ugavel.com (Cloudflare Pages) +on: + push: + paths: + - docs_website/** + +jobs: + publish-docs: + defaults: + run: + working-directory: ${{env.SUBFOLDER}} + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish to Cloudflare Pages + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: 3.x + + - run: echo "CACHE_ID=$(date --utc '+%V')" >> $GITHUB_ENV + + - uses: actions/cache@v3 + with: + key: mkdocs-material-${{ env.CACHE_ID }} + path: .cache + restore-keys: | + mkdocs-material- + + - run: pip install -r requirements.txt + + - name: Build + run: mkdocs build --site-dir public + + - name: Upload + env: + PROJECT_NAME: velconnect-docs + CLOUDFLARE_ACCOUNT_ID: 8077b5b1f8e2ade41874cbaa3f883069 + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + run: npx wrangler@3.1.1 pages deploy public --project-name="${{env.PROJECT_NAME}}" --branch="${{env.GITHUB_REF_NAME}}" diff --git a/docs_website/.gitignore b/docs_website/.gitignore new file mode 100644 index 0000000..04eaa16 --- /dev/null +++ b/docs_website/.gitignore @@ -0,0 +1,4 @@ +env/ +public/ +site/ +.venv/ \ No newline at end of file diff --git a/docs_website/.vscode/launch.json b/docs_website/.vscode/launch.json new file mode 100644 index 0000000..906667e --- /dev/null +++ b/docs_website/.vscode/launch.json @@ -0,0 +1,10 @@ +{ + "configurations": [ + { + "name": "Serve Docs", + "type": "node-terminal", + "request": "launch", + "command": "mkdocs serve" + } + ] +} \ No newline at end of file diff --git a/docs_website/.vscode/settings.json b/docs_website/.vscode/settings.json new file mode 100644 index 0000000..a11fa9b --- /dev/null +++ b/docs_website/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.terminal.activateEnvironment": true, +} \ No newline at end of file diff --git a/docs_website/.vscode/tasks.json b/docs_website/.vscode/tasks.json new file mode 100644 index 0000000..bf42bfa --- /dev/null +++ b/docs_website/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Autogenerate docs from code", + "detail": "Runs generate_docs.py", + "command": "python generate_docs.py", + "type": "shell", + "args": [], + "problemMatcher": [], + "presentation": { + "reveal": "always" + }, + "group": "build" + } + ] +} \ No newline at end of file diff --git a/docs_website/README.md b/docs_website/README.md new file mode 100644 index 0000000..f4c251f --- /dev/null +++ b/docs_website/README.md @@ -0,0 +1,19 @@ +# VEL-Connect Docs + +## Setup + +1. Create or activate a pip environment + - Create: + - `python -m venv env` + - Activate: + - PowerShell: `.\env\Scripts\Activate.ps1` + - CMD: `.\env\Scripts\Activate.bat` +2. Install requirements: + - `pip install -r requirements.txt` +3. Run: + - `mkdocs serve` + - or use `F5` in VSCode +4. Build and Deploy + - Building and deploying happens automatically using a GitHub Action on push. If you want to build manually, use this command: + - `mkdocs build` + - For more information, visit these docs pages: https://squidfunk.github.io/mkdocs-material/getting-started/ \ No newline at end of file diff --git a/docs_website/docs/assets/screenshots/scoped_registry.png b/docs_website/docs/assets/screenshots/scoped_registry.png new file mode 100644 index 0000000..a0cd3ff Binary files /dev/null and b/docs_website/docs/assets/screenshots/scoped_registry.png differ diff --git a/docs_website/docs/assets/vel_logo_3d.png b/docs_website/docs/assets/vel_logo_3d.png new file mode 100644 index 0000000..291df49 Binary files /dev/null and b/docs_website/docs/assets/vel_logo_3d.png differ diff --git a/docs_website/docs/assets/vel_logo_3d_square.png b/docs_website/docs/assets/vel_logo_3d_square.png new file mode 100644 index 0000000..6f61553 Binary files /dev/null and b/docs_website/docs/assets/vel_logo_3d_square.png differ diff --git a/docs_website/docs/guide/quick-start.md b/docs_website/docs/guide/quick-start.md new file mode 100644 index 0000000..0f0526d --- /dev/null +++ b/docs_website/docs/guide/quick-start.md @@ -0,0 +1,6 @@ +--- +title: Quick Start +--- + +1. [Install the package](/) +2. \ No newline at end of file diff --git a/docs_website/docs/index.md b/docs_website/docs/index.md new file mode 100644 index 0000000..799c95d --- /dev/null +++ b/docs_website/docs/index.md @@ -0,0 +1,46 @@ +# VEL-Connect + +VEL-Connect is a collection of utility scripts useful for VR Unity projects. + +## Installation + +Install the UPM package in Unity: + +=== "**Option 1:** Add the VEL package registry" + + ![Scoped registry example](assets/screenshots/scoped_registry.png){ align=right } + + Using the scoped registry allows you to easily install a specific version of the package by using the Version History tab. + + - In Unity, go to `Edit->Project Settings...->Package Manager` + - Under "Scoped Registries" click the + icon + - Add the following details, then click Apply + - Name: `VEL` (or anything you want) + - URL: `https://npm.ugavel.com` + - Scope(s): `edu.uga.engr.vel` + - Install the package: + - In the package manager, select `My Registries` from the dropdown + - Install the `VEL-Connect` package. + +=== "**Option 2:** Add the package by git url" + + 1. Open the Package Manager in Unity with `Window->Package Manager` + - Add the local package: + - `+`->`Add package from git URL...` + - Set the path to `https://github.com/velaboratory/VEL-Connect` + + To update the package, click the `Update` button in the Package Manager, or delete the `packages-lock.json` file. + +=== "**Option 3:** Add the package locally" + + 1. Clone the repository on your computer: + `git clone git@github.com:velaboratory/VEL-Connect.git` + - Open the Package Manager in Unity with `Window->Package Manager` + - Add the local package: + - `+`->`Add package from disk...` + - Set the path to `VEL-Connect/package.json` on your hard drive. + + To update the package, use `git pull` in the VEL-Connect folder. + + +Then check out the [samples](guide/samples.md), or follow the [quick start](guide/quick-start.md). \ No newline at end of file diff --git a/docs_website/docs/stylesheets/extra.css b/docs_website/docs/stylesheets/extra.css new file mode 100644 index 0000000..baf6c6e --- /dev/null +++ b/docs_website/docs/stylesheets/extra.css @@ -0,0 +1,15 @@ +:root { + --md-primary-fg-color: #666; + --md-primary-bg-color: hsla(0, 0%, 100%, 1); + + /* --md-accent-fg-color: #ffffff; + --md-accent-fg-color--transparent: #ffffff11; + --md-accent-bg-color: hsla(0, 0%, 100%, 1); + --md-accent-bg-color--light: hsla(0, 0%, 100%, 0.7); */ +} + +[data-md-color-scheme="slate"] { + --md-hue: 34; + --md-default-bg-color: #111; + --md-code-bg-color: #252525; +} \ No newline at end of file diff --git a/docs_website/mkdocs.yml b/docs_website/mkdocs.yml new file mode 100644 index 0000000..304d7ff --- /dev/null +++ b/docs_website/mkdocs.yml @@ -0,0 +1,59 @@ +site_name: VEL-Connect Docs +site_url: https://docs.velconnect.ugavel.com +repo_url: https://github.com/velaboratory/VEL-Connect +repo_name: velaboratory/VEL-Connect +edit_uri: edit/main/docs_website/docs + +theme: + name: material + features: + - content.action.edit + - navigation.instant + # - navigation.sections + - navigation.expand + - navigation.path + - navigation.indexes + - toc.follow + - toc.integrate + - content.code.copy + + palette: + scheme: slate + primary: custom + accent: red + # background: custom + font: false + # text: Oswald + # text: Merriweather + # text: Merriweather Sans + logo: assets/vel_logo_3d.png + favicon: assets/vel_logo_3d_square.png + +plugins: + - search: + # - social: + # cards_layout_options: + # font_family: Oswald + - git-revision-date-localized: + enable_creation_date: true + +markdown_extensions: + - attr_list + - md_in_html + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.superfences + - pymdownx.tabbed: + alternate_style: true + - admonition + - pymdownx.details + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.snippets + +extra_css: + - stylesheets/extra.css diff --git a/docs_website/requirements.txt b/docs_website/requirements.txt new file mode 100644 index 0000000..f522c59 --- /dev/null +++ b/docs_website/requirements.txt @@ -0,0 +1,2 @@ +mkdocs-material +mkdocs-git-revision-date-localized-plugin \ No newline at end of file