.mklcdd-web 1.3 KB
Newer Older
arpinux's avatar
arpinux committed
1
#!/bin/sh
arpinux's avatar
arpinux committed
2 3 4 5 6 7 8 9 10 11 12
# exporter the beginner's handbook en HTML
##########################################

LOG="pandoc.log"
MANTMP="the_beginners_handbook"
MANWEB="the_beginners_handbook.html"

# place nette
if test -f $LOG; then rm $LOG; fi
if test -f $MANWEB; then rm $MANWEB; fi

arpinux's avatar
arpinux committed
13 14
# make html-standalone
echo "\nexport en HTML depuis les sources MD\n"
arpinux's avatar
arpinux committed
15 16 17
pandoc \
    --verbose \
    -s -S --normalize \
arpinux's avatar
arpinux committed
18
    -f markdown \
arpinux's avatar
arpinux committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
    -t html5 \
    --toc --toc-depth=4 \
    --template=pandoc-tpl.html \
    --number-sections \
    pandoc-lcdd.txt \
    index.md \
    lcdd01-debian.md \
    lcdd02-initiation-info.md \
    lcdd03-initiation-gui.md \
    lcdd04-choix.md \
    lcdd05-installation.md \
    lcdd06-starting.md \
    lcdd07-configuration.md \
    lcdd08-administration.md \
    lcdd09-backup.md \
    lcdd10-privacy.md \
    lcdd11-command.md \
    lcdd12-annuaire.md \
    lcdd13-glossaire.md \
    lcdd14-sources.md \
    -o $MANWEB 2>&1 | tee $LOG

# test du HTML
if test -f $MANWEB; then
    echo "\n$MANWEB généré avec succès\n"
    echo "\ncompression de l'archive\n"
    mkdir $MANTMP
    cp -a img/ $MANTMP/
    cp $MANWEB $MANTMP/
    tar cvzf $MANWEB.tar.gz $MANTMP/
arpinux's avatar
arpinux committed
49
    echo "\nnettoyage\n"
arpinux's avatar
arpinux committed
50 51 52 53
    rm $LOG $MANWEB
    rm -Rf $MANTMP/
    exit 0
else
arpinux's avatar
arpinux committed
54
    echo "\nERROR: $MANWEB non généré > vérifiez le $LOG\n"
arpinux's avatar
arpinux committed
55 56 57
    exit 1
fi