Skip to content

Commit

Permalink
Update multi version
Browse files Browse the repository at this point in the history
  • Loading branch information
tengxianglin committed Aug 8, 2024
1 parent 7832309 commit 38e6dbd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/web_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/configure-pages@v5

- name: Cache pip # Step to cache pip packages.
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand Down
10 changes: 5 additions & 5 deletions docs/update_quairkit_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ def _update_conf_py(source_directory: str = _sphinx_source_dir):
html_short_title = "QuAIRKit"
build_dir = "api"
html_theme_options = {
'repo_url': 'https://github.com/QuAIR/QuAIRKit',
"repo_url": 'https://github.com/QuAIR/QuAIRKit',
"repo_name": 'QuAIRKit',
"palette": { "primary": "green" },
"version_dropdown": True,
"version_json": "versions.json",
Expand Down Expand Up @@ -297,10 +298,9 @@ def _create_redirect_html():
</body>
</html>
"""

file_path = os.path.join(".", "docs", "api", "index.html")

with open(file_path, 'w', encoding='utf-8') as file:
file_dir = os.path.join(".", "docs", "api")
os.makedirs(file_dir, exist_ok=True)
with open(os.path.join(file_dir, "index.html"), 'w', encoding='utf-8') as file:
file.write(html_content)


Expand Down
6 changes: 5 additions & 1 deletion version.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# Update system repositories and install Pandoc
sudo apt-get update
sudo apt-get install -y pandoc

# Check and install the Sphinx Material theme and nbsphinx if not already installed
pip show sphinx_immaterial || pip install sphinx_immaterial
pip show nbsphinx || pip install nbsphinx
Expand Down Expand Up @@ -62,8 +66,8 @@ done
git checkout $current_branch

# Build the final Sphinx documentation for the current branch
cp -r tutorials docs/sphinx_src/
python docs/update_quairkit_rst.py
cp -r tutorials docs/sphinx_src/tutorials
echo "$version_info_content" >> docs/sphinx_src/conf.py
sphinx-build docs/sphinx_src docs/api/latest

Expand Down

0 comments on commit 38e6dbd

Please sign in to comment.