Skip to content

Commit

Permalink
[DOCS] Fix listing of notebooks with badges (#1819)
Browse files Browse the repository at this point in the history
Fix for collecting information on which notebooks have the Binder and
Google Colab badges.
  • Loading branch information
sgolebiewski-intel authored Mar 13, 2024
1 parent 985420f commit dd5db32
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .ci/convert_notebooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ tagslist=$rstdir"/notebooks_tags.json"
mkdir -p $rstdir

# List all notebooks that contain binder or colab buttons based on readme
cat README.md | grep -oP "https://mybinder.org/v2.*?[0-9]{3}.*?ipynb" | sed 's#%2F#/#g' | xargs basename -a -s .ipynb | sort | uniq > $binderlist
cat README.md | grep -oP "https://colab.research.google.com/github.*?[0-9]{3}.*?ipynb" | xargs basename -s .ipynb | sort | uniq > $colablist
for n in $(git ls-files '*.ipynb' ':!:*utils.ipynb'| head); do
cat ${n%/*}"/README.md" | grep -oP "https://mybinder.org/v2.*?[0-9]{3}.*?ipynb" | sed 's#%2F#/#g' | xargs basename -a -s .ipynb {} | sort | uniq > $binderlist
cat ${n%/*}"/README.md" | grep -oP "https://colab.research.google.com/github.*?[0-9]{3}.*?ipynb" | xargs basename -s .ipynb {} | sort | uniq > $colablist
done
find notebooks -maxdepth 2 -name "*.ipynb" | sort > $notebooklist
taggerpath=$(git ls-files "*tagger.py")
notebookspath=$(git ls-files "*.ipynb"| head -n 1)
Expand Down

0 comments on commit dd5db32

Please sign in to comment.