Skip to content

Commit

Permalink
fix: GH-42 testing without docker uses diff theme (#122)
Browse files Browse the repository at this point in the history
* fix: GH-42 testing without docker uses diff theme

* docs: fixed #42
  • Loading branch information
wesleyboar authored Feb 5, 2025
1 parent 629f43c commit 29c4268
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ How to Contribute **Other Changes**:

### A. Via Python

> [!IMPORTANT]
> This method has different theme than [live website](https://designsafe-ci.org/user-guide/) ([#42](https://github.com/DesignSafe-CI/DS-User-Guide/issues/42)) **and** bugs ([#66](https://github.com/DesignSafe-CI/DS-User-Guide/issues/66)).
0. Have [Python](https://www.python.org/) installed.\
<sup>Known supported versions are [from 3.10 to 3.12](https://github.com/TACC/TACC-Docs/blob/v0.10.1/pyproject.toml#L9).</sup>
1. [Install Poetry](https://python-poetry.org/docs/#installation) to manage dependencies.\
Expand All @@ -45,12 +42,14 @@ How to Contribute **Other Changes**:
<sup>You should only need to do this after new releases.</sup>
```shell
../bin/tacc-setup.sh
poetry install
poetry install --sync

```
4. Serve the docs:
```shell
poetry shell
mkdocs serve
```
<sup>After the `poetry shell` command, you should be in a Poetry-managed environment. Your prompt might be prefixed with the name of the environment.</sup>
5. Open the website _at the URL echoed by the program_ e.g.
Expand Down
30 changes: 19 additions & 11 deletions bin/tacc-setup.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
#!/bin/bash

# To provide files via a CDN from TACC at a specific commit
BASE_URL="https://cdn.jsdelivr.net/gh/TACC/TACC-Docs@v0.15.1"
# What version of TACC-Docs to use
TACC_VER=v0.15.1
# Where to get files from TACC
BASE_URL="https://cdn.jsdelivr.net/gh/TACC/TACC-Docs@${TACC_VER}"
# Get the directory where the script resides
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
# Create a temporary directory for the TACC docs
TACC_DIR="${ROOT_DIR}/_temp-tacc-docs-for-ds"

# To avoid the error:
# > ERROR - Config value 'theme': The path set in custom_dir
# > ('.../user-guide/themes/tacc-readthedocs') does not exist.
mkdir -p ./user-guide/themes/tacc-readthedocs
# So authors can preview with TACC features but without Docker
curl -o "${ROOT_DIR}/user-guide/mkdocs.base.yml" ${BASE_URL}/mkdocs.base.yml
curl -o "${ROOT_DIR}/user-guide/poetry.lock" ${BASE_URL}/poetry.lock
curl -o "${ROOT_DIR}/user-guide/pyproject.toml" ${BASE_URL}/pyproject.toml

# To clone TACC files (so authors can preview without Docker)
# TODO: Make TACC/TACC-Docs public, so we can load from TACC/TACC-Docs via CDN
curl -o ./user-guide/mkdocs.base.yml ${BASE_URL}/mkdocs.base.yml
curl -o ./user-guide/poetry.lock ${BASE_URL}/poetry.lock
curl -o ./user-guide/pyproject.toml ${BASE_URL}/pyproject.toml
# So authors can preview with TACC design but without Docker
mkdir -p "${ROOT_DIR}/user-guide/themes/tacc-readthedocs"
git clone -q --depth 1 --branch ${TACC_VER} https://github.com/TACC/TACC-Docs.git ${TACC_DIR}
cp -r ${TACC_DIR}/themes/tacc-readthedocs "${ROOT_DIR}/user-guide/themes/"
cp -r ${TACC_DIR}/docs/css/core "${ROOT_DIR}/user-guide/docs/css/"
cp -r ${TACC_DIR}/docs/js/core "${ROOT_DIR}/user-guide/docs/js/"
rm -rf ${TACC_DIR}

0 comments on commit 29c4268

Please sign in to comment.