Skip to content

Commit 6dcb42e

Browse files
author
Aoife
committed
perl?
1 parent 997eac5 commit 6dcb42e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

assets/scripts/add_notebook_links.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ find _site/tutorials _site/usage _site/developers -name "index.html" 2>/dev/null
3737

3838
# Insert both download and Colab links AFTER the "Report an issue" link
3939
# The download="index.ipynb" attribute forces browser to download instead of navigate
40-
perl -i -pe 's/(<a href="[^"]*issues\/new"[^>]*><i class="bi[^"]*"><\/i>Report an issue<\/a><\/li>)/$1<li><a href="index.ipynb" class="toc-action" download="index.ipynb"><i class="bi bi-journal-code"><\/i>'"$DOWNLOAD_TEXT"'<\/a><\/li><li><a href="'"$colab_url"'" class="toc-action" target="_blank" rel="noopener"><i class="bi bi-google"><\/i>'"$COLAB_TEXT"'<\/a><\/li>/g' "$html_file"
40+
perl -i -pe 's|(<a href="[^"]*issues/new"[^>]*><i class="bi[^"]*"></i>Report an issue</a></li>)|$1<li><a href="index.ipynb" class="toc-action" download="index.ipynb"><i class="bi bi-journal-code"></i>'"$DOWNLOAD_TEXT"'</a></li><li><a href="'"$colab_url"'" class="toc-action" target="_blank" rel="noopener"><i class="bi bi-google"></i>'"$COLAB_TEXT"'</a></li>|g' "$html_file"
4141
echo " ✓ Added notebook links to $html_file"
4242
fi
4343
fi

0 commit comments

Comments
 (0)