1
0
forked from cheng/wallet
wallet/docs/mkdocs.sh
reaction.la c475f46de2
moved markdown files from root directory
(since everyone has a browser, text is obsolete)
modified:   docs/libraries.md
deleted:    docs/libraries/pandoc_templates/style.css
modified:   docs/merkle_patricia_dag.md
modified:   docs/mkdocs.sh
renamed:    LICENSE.md -> docs/rootDocs/LICENSE.md
renamed:    NOTICE.md -> docs/rootDocs/NOTICE.md
renamed:    README.md -> docs/rootDocs/README.md
renamed:    RELEASE_NOTES.md -> docs/rootDocs/RELEASE_NOTES.md
new file:   docs/scalable_reputation_management.md
modified:   docs/scale_clients_trust.md
modified:   docs/set_up_build_environments.md
modified:   docs/writing_and_editing_documentation.md
deleted:    pandoc_templates/style.css
2022-05-20 21:44:46 +10:00

82 lines
2.0 KiB
Bash

#!/bin/bash
set -e
cd `dirname $0`
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
osoptions=""
elif [[ "$OSTYPE" == "darwin"* ]]; then
osoptions=""
elif [[ "$OSTYPE" == "cygwin" ]]; then
osoptions="--fail-if-warnings --eol=lf "
elif [[ "$OSTYPE" == "msys" ]]; then
osoptions="--fail-if-warnings --eol=lf "
fi
templates="./pandoc_templates"
options=$osoptions"--toc -N --toc-depth=5 --wrap=preserve --metadata=lang:en --include-in-header=$templates/icon.pandoc --include-before-body=$templates/before.pandoc --css=$templates/style.css -o"
for f in *.md
do
len=${#f}
base=${f:0:($len-3)}
if [ $f -nt $base.html ];
then
katex=""
mine="--include-after-body=$templates/after.pandoc "
for i in 1 2 3 4 5 6
do
read line
if [[ $line =~ katex$ ]];
then
katex=" --katex=./"
fi
if [[ $line =~ notmine$ ]];
then
mine=" "
fi
done <$f
pandoc $katex $mine $options $base.html $base.md
echo "$base.html from $f"
#else
# echo " $base.html up to date"
fi
done
cd libraries
templates="../pandoc_templates"
options=$osoptions"--toc -N --toc-depth=5 --wrap=preserve --metadata=lang:en --include-in-header=$templates/icondotdot.pandoc --include-before-body=$templates/beforedotdot.pandoc --css=$templates/style.css --include-after-body=$templates/after.pandoc -o"
for f in *.md
do
len=${#f}
base=${f:0:($len-3)}
if [ $f -nt $base.html ];
then
katex=""
for i in 1 2 3 4
do
read line
if [[ $line =~ katex ]];
then
katex=" --katex=./"
fi
done <$f
pandoc $katex $options $base.html $base.md
echo "$base.html from $f"
#else
# echo " $base.html up to date"
fi
done
cd ../rootDocs
templates="../pandoc_templates"
for f in *.md
do
len=${#f}
base=${f:0:($len-3)}
if [ $f -nt ../../$base.html ];
then
pandoc $osoptions --wrap=preserve --from markdown --to html --metadata=lang:en --css=$templates/style.css --self-contained -o ../../$base.html $base.md
#--include-in-header=style.css
echo "../..$base.html from $f"
#else
# echo " $base.html up to date"
fi
done