51 lines
1.8 KiB
Bash
51 lines
1.8 KiB
Bash
#!/bin/bash
|
|
|
|
|
|
# Ce script sert à publier le WhitePaper.
|
|
# La première version crée les documents whitepaper.md et whitepaper.html.
|
|
# Le doc Markdown complet est volontairement supprimé. Je préfère que les modifications soient faites sur les différentes parties.
|
|
# ce script doit être lancé dans le dossier contenant les chapitres.
|
|
echo "=============== génération de mon ebook, c'est parti! =============== "
|
|
# dépendances : sphinx-build pandoc
|
|
hash sphinx-build 2>/dev/null || { echo >&2 "Ce générateur a besoin de la commande sphinx-build pour fonctionner. Mais cette commande n'est pas installée. Fin de l'exécution."; exit 1; }
|
|
hash pandoc 2>/dev/null || { echo >&2 "Ce générateur peut utiliser ebook-convert fourni avec Calibre, disponible dans les dépots apt. Mais cette commande n'est pas installée. Fin de l'exécution."; exit 1; }
|
|
|
|
# clean build
|
|
rm -rf build/*
|
|
|
|
## Compilation HTML des différents chapitres
|
|
cp source/base_index.rst source/index.rst
|
|
for i in chapitres/*.rst ; do
|
|
cat $i >> source/index.rst
|
|
done
|
|
|
|
sphinx-build -b html source build
|
|
|
|
if [ -e build/index.html ] ; then
|
|
echo "===== HTML OK ====="
|
|
fi
|
|
|
|
## Compilation PDF
|
|
sphinx-build -M latexpdf source build
|
|
# deplacement dans le fichier de build
|
|
mv ./build/latex/mon_book.pdf ./build/
|
|
|
|
#firefox "$PWD/build/whitepaper_en.html"
|
|
## add ebook conversion
|
|
|
|
#ebook-convert build/whitepaper_fr.html build/whitepaper_fr.mobi
|
|
#ebook-convert build/whitepaper_en.html build/whitepaper_en.mobi
|
|
#ebook-convert build/whitepaper_fr.html build/whitepaper_fr.fb2
|
|
#ebook-convert build/whitepaper_en.html build/whitepaper_en.fb2
|
|
#ebook-convert build/whitepaper_fr.html build/whitepaper_fr.epub
|
|
#ebook-convert build/whitepaper_en.html build/whitepaper_en.epub
|
|
|
|
echo " "
|
|
echo "===== ok pour la génération d'ebooks"
|
|
ls -lArth build
|
|
|
|
|
|
# clean fichiers temporaires
|
|
|
|
|