" >> tmp/content.textile
for i in ../content/*; do
# if folder if not sys if not modele
if [ -d "$i" ] && [[ ! "$i" =~ "model" ]]; then
# if readme exists
if [ -f "$i/readme.textile" ]; then
# user name
# record readme content on variable
cont=$(cat "$i/readme.textile")
echo "$i"
# echo "$cont"
# user=$(grep "h1\.\s*.+" "$i/readme.textile")
# user="${cont% h1}"
# user=$(expr "$cont" : "h1. \(.*\)$")
# echo "user : $user"
u=${i/..\//}
# record link for menu
# echo "$u" >> tmp/summary
u=${u/content//}
id=${u:2}
echo "* \"$id\":#$id" >> tmp/summary
# right html and contents on main tmp/content.textile
echo "" >> tmp/content.textile
# add user content to main content
echo "
"$'\n' >> tmp/content.textile
# add content to main tmp/content.textile
cat "$i/readme.textile" >> tmp/content.textile
echo $'\n'"" >> tmp/content.textile
# get folder name
folder=$(basename "$i")
# _
# (_)
# _ _ __ ___ __ _ __ _ ___ ___
# | | '_ ` _ \ / _` |/ _` |/ _ \/ __|
# | | | | | | | (_| | (_| | __/\__ \
# |_|_| |_| |_|\__,_|\__, |\___||___/
# __/ |
# |___/
echo " images"
images=""
l=0
echo "
" >> tmp/content.textile
# _________ __ _______________ _____
# / ___/ __ \/ / / / ___/ ___/ _ \/ ___/
# (__ ) /_/ / /_/ / / / /__/ __(__ )
# /____/\____/\__,_/_/ \___/\___/____/
#
echo " sources"
echo "
"$'\n' >> tmp/content.textile
for src in $i/sources/*; do
# echo "patch : $src"
if [ -f "$src" ]; then
# if ~ is not on file name ...
if [[ ! "$src" =~ "~" ]]; then
# record file name
fn=$(basename "$src")
cp -f "$src" ../output/sources/$i/$fn
# echo $'\r'"" >> tmp/content.textile
echo "* \"$fn\":sources/$i/$fn" >> tmp/content.textile
# echo $'\r'"" >> tmp/content.textile
fi
fi
done
echo $'\n'"" >> tmp/content.textile
echo "
" >> tmp/content.textile
echo '' >> tmp/content.textile
fi
fi
done
# ____ __
# / __ \____ _____/ /
# / /_/ / __ `/ __ /
# / ____/ /_/ / /_/ /
# /_/ \__,_/\__,_/
# curl http://pads.osp.kitchen/p/ola-workshop/export/txt -o tmp/pad.md
curl https://mypads.framapad.org/p/ola-5doc-6117z7kl/export/txt -o tmp/pad.md
echo "* \"Pad\":#pad" >> tmp/summary
# right html and contents on main tmp/content.textile
echo "" >> tmp/content.textile
echo "
Pad
" >> tmp/content.textile
# add user content to main content
echo ""$'\n' >> tmp/content.textile
# add content to main tmp/content.textile
pandoc -f markdown -t textile -o tmp/pad.textile tmp/pad.md
cat tmp/pad.textile >> tmp/content.textile
echo $'\n'"" >> tmp/content.textile
echo "" >> tmp/content.textile
echo '' >> tmp/content.textile
# ______ __ ____ __
# / ____/___ ____ / /__/ __ )____ ____ / /__
# / / / __ \/ __ \/ //_/ __ / __ \/ __ \/ //_/
# / /___/ /_/ / /_/ / ,< / /_/ / /_/ / /_/ / ,<
# \____/\____/\____/_/|_/_____/\____/\____/_/|_|
# curl http://pads.osp.kitchen/p/ola-cookbook/export/txt -o tmp/cookbook.md
#
# echo "* \"CookBook\":#cookbook" >> tmp/summary
#
# # right html and contents on main tmp/content.textile
# echo "" >> tmp/content.textile
# echo "
CookBook
" >> tmp/content.textile
# # add user content to main content
# echo ""$'\n' >> tmp/content.textile
# # add content to main tmp/content.textile
# pandoc -f markdown -t textile -o tmp/cookbook.textile tmp/cookbook.md
# cat tmp/cookbook.textile >> tmp/content.textile
# echo $'\n'"" >> tmp/content.textile
# echo "" >> tmp/content.textile
#
# echo '' >> tmp/content.textile
# end main section
echo "" >> tmp/content.textile
# _ _
# | | | |
# | |__ ___ __ _ __| | ___ _ __
# | '_ \ / _ \/ _` |/ _` |/ _ \ '__|
# | | | | __/ (_| | (_| | __/ |
# |_| |_|\___|\__,_|\__,_|\___|_|
echo "header"
touch tmp/header
echo "" >> tmp/header
cat tmp/header|cat - tmp/content.textile > tmp/out && mv tmp/out tmp/content.textile
echo "Pandoc"
pandoc -s \
-f textile \
-t html5 -o ../output/index.html \
-H style.tpl.html \
-A script.tpl.html \
tmp/content.textile
# -H css/main.css \
cp -r css ../output/
cp -r fonts ../output/
cp -r bower_components ../output/
# echo "export markdown as html"
# pandoc -s \
# -f markdown+hard_line_breaks+auto_identifiers+ascii_identifiers+tex_math_dollars+pipe_tables+all_symbols_escapable \
# -t html5 -o index.html \
# -c fonts/amiri/amiri.css \
# -H bower_components/lightbox2/dist/css/lightbox.min.css \
# -H css/styles.css \
# -B body-base-top.tpl.html \
# -A body-base-bot.tpl.html \
# -A js/jquery.min.js \
# -A js/script.js \
# # -A js/css-regions-polyfill.min.js \
# -A body-base-end.tpl.html \
# pad.md