Clean up docs folder by moving all build-related tools to subdirectory

This commit is contained in:
Ivan Blinkov 2018-07-09 15:14:26 +03:00
parent 610bb98eab
commit 9e2bb1ac0b
74 changed files with 29 additions and 28 deletions

6
.gitignore vendored
View File

@ -10,10 +10,8 @@
*.logrt
/build
/docs/en_single_page/
/docs/ru_single_page/
/docs/venv/
/docs/build/
/docs/build
/docs/tools/venv/
/docs/en/development/build/
/docs/ru/development/build/

View File

@ -1,19 +0,0 @@
#!/bin/bash
set -e
if [ $# -lt 1 ]; then
LANGS="ru en"
elif [[ $# -eq 1 ]]; then
LANGS=$1
fi
for lang in $LANGS; do
echo -e "\n\nLANG=$lang. Creating single page source"
mkdir $lang'_single_page' 2>/dev/null || true
cp -r $lang/images $lang'_single_page'
./concatenate.py $lang
echo -e "\n\nLANG=$lang. Building multipage..."
mkdocs build -f mkdocs_$lang.yml
echo -e "\n\nLANG=$lang. Building single page..."
mkdocs build -f mkdocs_$lang'_single_page.yml'
done

View File

@ -19,7 +19,7 @@ markdown_extensions:
theme:
name: null
custom_dir: 'mkdocs-material-theme'
custom_dir: 'tools/mkdocs-material-theme'
language: 'en'
feature:
tabs: false

View File

@ -17,7 +17,7 @@ markdown_extensions:
theme:
name: null
custom_dir: 'mkdocs-material-theme'
custom_dir: 'tools/mkdocs-material-theme'
language: 'en'
feature:
tabs: false

View File

@ -18,7 +18,7 @@ markdown_extensions:
theme:
name: null
custom_dir: 'mkdocs-material-theme'
custom_dir: 'tools/mkdocs-material-theme'
language: 'ru'
feature:
tabs: false

View File

@ -17,7 +17,7 @@ markdown_extensions:
theme:
name: null
custom_dir: 'mkdocs-material-theme'
custom_dir: 'tools/mkdocs-material-theme'
language: 'ru'
feature:
tabs: false

22
docs/tools/build.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
DOCS_DIR="${BASE_DIR}/.."
if [ $# -lt 1 ]; then
LANGS="ru en"
elif [[ $# -eq 1 ]]; then
LANGS=$1
fi
for lang in $LANGS; do
cd ${DOCS_DIR}
echo -e "\n\nLANG=$lang. Creating single page source"
mkdir $lang'_single_page' 2>/dev/null || true
cp -r $lang/images $lang'_single_page'
./tools/concatenate.py $lang
echo -e "\n\nLANG=$lang. Building multipage..."
mkdocs build -f mkdocs_$lang.yml
echo -e "\n\nLANG=$lang. Building single page..."
mkdocs build -f mkdocs_$lang'_single_page.yml'
rm -rf $lang'_single_page'
done

View File

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -58,7 +58,7 @@ gulp.task('reference', [], function () {
});
gulp.task('docs', [], function () {
run('cd ' + docsDir + '; ./build.sh');
run('cd ' + docsDir + '/tools; ./build.sh');
return gulp.src(paths.docs)
.pipe(gulp.dest(outputDir + '/../docs'))
});