/
githubmirror
/
d2l-zh
Обзор
Документация
Войти
/
githubmirror
/
d2l-zh
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
.github/workflow_scripts/build_html.sh
24 строки
2 KB
Anirudh Dagar
CI: Setup D2L Infra 2.0 with Github Actions (#1281)
09 авг 2023, 15:00
Не верифицирован
09 авг 2023, 15:00
b285792
Код
Авторство
О чём код?
#!/bin/bash set -e rm -rf _build/rst _build/html d2lbook build rst --tab all cp static/frontpage/frontpage.html _build/rst_all/ d2lbook build html --tab all cp -r static/frontpage/_images/* _build/html/_images/ for fn in `find _build/html/_images/ -iname '*.svg' `; do if [[ $fn == *'qr_'* ]] ; then # || [[ $fn == *'output_'* ]] continue fi # rsvg-convert installed on ubuntu changes unit from px to pt, so evening no # change of the size makes the svg larger... rsvg-convert -z 1 -f svg -o tmp.svg $fn mv tmp.svg $fn done # Add SageMaker Studio Lab buttons for f in _build/html/chapter*/*.html; do sed -i s/Open\ the\ notebook\ in\ Colab\<\\\/div\>\<\\\/div\>\<\\\/div\>\<\\\/h1\>/Open\ the\ notebook\ in\ Colab\<\\\/div\>\<\\\/div\>\<\\\/div\>\<a\ href=\"https:\\\/\\\/studiolab.sagemaker.aws\\\/import\\\/github\\\/d2l-ai\\\/d2l-pytorch-sagemaker-studio-lab\\\/blob\\\/main\\\/GettingStarted-D2L.ipynb\"\ onclick=\"captureOutboundLink\\\(\'https\:\\\/\\\/studiolab.sagemaker.aws\\\/import\\\/github\\\/d2l-ai\\\/d2l-pytorch-sagemaker-studio-lab\\\/blob\\\/main\\\/GettingStarted-D2L.ipynb\'\\\)\;\ return\ false\;\"\>\ \<button\ style=\"float\:right\",\ id=\"SageMaker\_Studio\_Lab\"\ class=\"mdl-button\ mdl-js-button\ mdl-button--primary\ mdl-js-ripple-effect\"\>\ \<i\ class=\"\ fas\ fa-external-link-alt\"\>\<\\\/i\>\ SageMaker\ Studio\ Lab\ \<\\\/button\>\<\\\/a\>\<div\ class=\"mdl-tooltip\"\ data-mdl-for=\"SageMaker\_Studio\_Lab\"\>\ Open\ the\ notebook\ in\ SageMaker\ Studio\ Lab\<\\\/div\>\<\\\/h1\>/g $f done