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

fix: remove unecessary _tket perfix in local docs build #1721

Merged
merged 10 commits into from
Dec 13, 2024
Merged
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
27 changes: 0 additions & 27 deletions pytket/docs/Makefile

This file was deleted.

18 changes: 17 additions & 1 deletion pytket/docs/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,23 @@ cp -R pytket-docs-theming/_static .
cp -R pytket-docs-theming/quantinuum-sphinx .
cp pytket-docs-theming/conf.py .

sphinx-build -b html . build -D html_title="pytket"
# Get pytket package version to be used in page title
PYTKET_VERSION="$(pip show pytket| grep Version | awk '{print $2}')"

PACKAGE="pytket $PYTKET_VERSION"

# Build the docs setting the html title to show the correct pytket version.
sphinx-build -b html . build -D html_title="$PACKAGE API documentation"

# Replace unnecessary _tket for all classes and functions in the built html
# Apple MACOSX and Linux have differing sed replace syntax
if [[ "$OSTYPE" == "darwin"* ]]; then
find build/ -type f -name "*.html" | xargs sed -e 's/pytket._tket/pytket/g' -i ""
sed -i '' 's/pytket._tket/pytket/g' build/searchindex.js
else
find build/ -type f -name "*.html" | xargs sed -i 's/pytket._tket/pytket/g'
sed -i 's/pytket._tket/pytket/g' build/searchindex.js
fi

# Remove copied files. This ensures reusability.
rm -r _static
Expand Down
Loading