" >> 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 "$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
echo "* \"$u\":#$u" >> /tmp/summary
# right html and contents on main content.textile
echo "" >> content.textile
# add user content to main content
echo "
"$'\n' >> content.textile
# add content to main content.textile
cat "$i/readme.textile" >> content.textile
echo $'\n'"" >> content.textile
# get folder name
folder=$(basename "$i")
# _
# (_)
# _ _ __ ___ __ _ __ _ ___ ___
# | | '_ ` _ \ / _` |/ _` |/ _ \/ __|
# | | | | | | | (_| | (_| | __/\__ \
# |_|_| |_| |_|\__,_|\__, |\___||___/
# __/ |
# |___/
images=""
l=0
echo "
" >> content.textile
# _________ __ _______________ _____
# / ___/ __ \/ / / / ___/ ___/ _ \/ ___/
# (__ ) /_/ / /_/ / / / /__/ __(__ )
# /____/\____/\__,_/_/ \___/\___/____/
#
echo "
"$'\n' >> 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/$fn
# echo $'\r'"" >> content.textile
echo "* \"$fn\":sources/$fn" >> content.textile
# echo $'\r'"" >> content.textile
fi
fi
done
echo $'\n'"" >> content.textile
echo "
" >> content.textile
echo '' >> content.textile
fi
fi
done
# end main section
echo "" >> content.textile
# _ _
# | | | |
# | |__ ___ __ _ __| | ___ _ __
# | '_ \ / _ \/ _` |/ _` |/ _ \ '__|
# | | | | __/ (_| | (_| | __/ |
# |_| |_|\___|\__,_|\__,_|\___|_|
touch /tmp/header
echo "" >> /tmp/header
cat /tmp/header|cat - content.textile > /tmp/out && mv /tmp/out content.textile
pandoc -s \
-f textile \
-t html5 -o ../output/index.html \
-H css/lightbox.min.css \
-H css/main.css \
-A script.tpl.html \
content.textile
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