#!/bin/bash # 06-07-2016 # Licence : GPLv3 echo "generating publication" # echo "creating folders" # if [ ! -d ../output ]; then # mkdir ../content # fi # if [ ! -d ../content/images ]; then # mkdir ../content/images # fi # # if [ ! -d ../content/thumbs ]; then # mkdir ../content/thumbs # fi # # if [ ! -d ../content/sources ]; then # mkdir ../content/sources # fi # if [ -f content.textile ]; then # rm content.textile # fi if [ ! -d temp ]; then rm -rf tmp fi mkdir tmp touch tmp/content.textile touch tmp/summary # echo "" > tmp/summary echo "reading content" # _ _ # | | | | # ___ ___ _ __ | |_ ___ _ __ | |_ # / __/ _ \| '_ \| __/ _ \ '_ \| __| # | (_| (_) | | | | || __/ | | | |_ # \___\___/|_| |_|\__\___|_| |_|\__| echo "
" >> 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/publi.textile" ]; then # user name # record readme content on variable # cont=$(cat "$i/publi.textile") echo "$i" 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 # get meta data # add content to main tmp/content.textile cat "$i/publi.textile" >> tmp/content.textile echo $'\n'"
    " >> tmp/content.textile # get folder name folder=$(basename "$i") echo "
    " >> tmp/content.textile echo '
    ' >> tmp/content.textile fi fi done # 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 ./index.html \ -H style.tpl.html \ -A script.tpl.html \ tmp/content.textile # -H css/main.css \