Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Use shared pytket docs config [DRAFT] #228

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ jobs:
python -m pytest
- name: Sphinx documentation build
run: |
make docs
bash docs/build-docs.sh
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.deploy-gh-pages }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html/
publish_dir: docs/build/
force_orphan: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ instance/

# Sphinx documentation
docs/_build/
docs/pyproject.toml
docs/poetry.lock
docs/build

# PyBuilder
.pybuilder/
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "docs/pytket-docs-theming"]
path = docs/pytket-docs-theming
url = https://github.com/CQCL/pytket-docs-theming.git
branch = main
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Building the docs

The docs are built by using the [pytket-docs-theming](https://github.com/CQCL/pytket-docs-theming/) repository as a git submodule. If there are issues with the docs build, feel free to open an issue or pull request there.

For instructions on how to build the docs, take a look at the [extensions README](https://github.com/CQCL/pytket-docs-theming/blob/main/extensions/README.md).
20 changes: 20 additions & 0 deletions docs/build-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
rm -rf build/

# Move theming elements into the docs folder
cp -R pytket-docs-theming/_static .
cp -R pytket-docs-theming/quantinuum-sphinx .
cp pytket-docs-theming/conf.py .

# Get the name of the project
EXTENSION_NAME="$(basename "$(dirname `pwd`)")"

# Correct github link in navbar
sed -i '' 's#CQCL/tket#CQCL/'$EXTENSION_NAME'#' _static/nav-config.js

# Build the docs. Ensure we have the correct project title.
sphinx-build -b html -D html_title="$EXTENSION_NAME" . build

# Remove copied files. This ensures reusability.
rm -r _static
rm -r quantinuum-sphinx
rm conf.py
File renamed without changes.
9 changes: 9 additions & 0 deletions docs/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# Copy over poetry dependencies from theming repository
cp pytket-docs-theming/extensions/pyproject.toml .
cp pytket-docs-theming/extensions/poetry.lock .

# Install the docs dependencies. Creates a .venv directory in docs
poetry install

# NOTE: Editable wheel should be installed separately.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/pytket-docs-theming
Submodule pytket-docs-theming added at 7141e7
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 0 additions & 46 deletions docs/source/conf.py

This file was deleted.

Loading