/
alwaysdata_projects
/
api
Обзор
Документация
Войти
/
alwaysdata_projects
/
api
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
main
dl-docs.sh
31 строка
853 B
qx
init
09 июл 2026, 22:02
09 июл 2026, 22:02
d63d59f
Код
Авторство
О чём код?
#!/bin/bash URL="https://api.alwaysdata.com/doc/" CSS_URL="https://yastatic.net/bootstrap/3.0.0/css/bootstrap.min.css" OUT_DIR="site" rm -rf "$OUT_DIR" wget --mirror --convert-links --adjust-extension --page-requisites -l 2 -nH \ --header="Accept-Language: en" \ -P "$OUT_DIR" \ "$URL" mkdir -p "$OUT_DIR/css" if wget -q -O "$OUT_DIR/css/bootstrap.min.css" --timeout=10 "$CSS_URL"; then echo "CSS downloaded" else echo "CSS download failed (non-critical)" fi cd "$OUT_DIR" find . -name index.html | while read f; do rel="${f#./}" depth=$(echo "$rel" | grep -o '/' | wc -l) prefix="" [ "$depth" -gt 0 ] && for i in $(seq 1 $depth); do prefix="$prefix../"; done sed -i "s|https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css|${prefix}css/bootstrap.min.css|g" "$f" done echo "Done. Open $OUT_DIR/doc/index.html"