Commit 9b88f361 authored by Jan Uhlík's avatar Jan Uhlík

wip

parent 8e543458
Pipeline #120342907 passed with stage
in 46 seconds
......@@ -14,38 +14,31 @@ adoc2html() {
output_file="public/${input_file%%.adoc}.html"
filename="$(basename $file)"
echo -n Converting article: \'"$input_file"\'
echo -n "Converting file: '$input_file'"
asciidoctor -o "$output_file" "$input_file"
echo ' [DONE]'
}
# Presentaion to HTML
adoc2revealjs() {
input_file="$1"
output_file="public/${input_file%%.adoc}.html"
filename="$(basename $file)"
echo -n Converting presentation: \'"$input_file"\'
asciidoctor-revealjs -a revealjsdir="$REVEALJS_VERSION" -o "$output_file" "$input_file"
if [[ "$2" == "article" ]];then
asciidoctor -o "$output_file" "$input_file"
elif [[ "$2" == "presentation" ]];then
asciidoctor-revealjs -a revealjsdir="$REVEALJS_VERSION" -o "$output_file" "$input_file"
else
echo "Error - unknown file type: '$2'"
fi
echo ' [DONE]'
}
# Convert all articles
for file in {czech,english}/*/article.adoc; do
adoc2html "$file"
adoc2html "$file" "article"
done
# Convert all presentation
for file in {czech,english}/*/presentation.adoc; do
adoc2revealjs "$file"
adoc2html "$file" "presentation"
done
# Copy static file
for file in {czech,english}/*/{images,custom.css}; do
for file in {czech,english}/*/{images,meta,custom.css}; do
echo -n "Copying static file(s):" \'"$file"\'
cp -r "$file" "public/$file"
......@@ -54,6 +47,6 @@ for file in {czech,english}/*/{images,custom.css}; do
done
# Convert index page
adoc2html "README.adoc"
mv public/README.html public/index.html
adoc2html "README.adoc" "article"
# mv public/README.html public/index.html
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment