Skip to content

Commit

Permalink
uupdate script to align with website build
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMacCQ committed Dec 13, 2024
1 parent 712d12e commit 887442b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pytket/docs/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@ cp -R pytket-docs-theming/_static .
cp -R pytket-docs-theming/quantinuum-sphinx .
cp pytket-docs-theming/conf.py .

# Replace unnecessary _tket for all classes and functions

# Get pytket extension version
PYTKET_VERSION="$(pip show pytket| grep Version | awk '{print $2}')"

PACKAGE="pytket $PYTKET_VERSION"

# Build the docs
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
sphinx-build -b html . build -D html_title="pytket"
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
Expand Down

0 comments on commit 887442b

Please sign in to comment.