info:asciidoc:bashscript

Exemples de scripts bash asciidoc/asciidoctor/pandoc faits par MaPomme

#! /usr/bin/bash
 
###########################################################################
#   Script to generate html, pdf and odt from an asciidoc                 #
#                                                                         #
#   Copyright information                                                 #
#                                                                         #
#	Copyright (C) 2018 Fred Radeff <fradeff@akademia.ch>              #
#                                                                         #
#   License                                                               #
#   This program is free software; you can redistribute it and/or modify  #
#   it under the terms of the GNU General Public License as published by  #
#   the Free Software Foundation; either version 2 of the License, or     #
#   (at your option) any later version.                                   #
#                                                                         #
#   This program is distributed in the hope that it will be useful,       #
#   but WITHOUT ANY WARRANTY; without even the implied warranty of        #
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          #
#   GNU General Public License for more details.                          #
#                                                                         #
#   You should have received a copy of the GNU General Public License     #
#   along with this program. If not, see <http://www.gnu.org/licenses/>.  #
#                                                                         #
###########################################################################
 
chemin=/home/radeff/ebooks/polars/Radeff_Fred_polars/Funkei/
livre=book
 
echo "destroy old versions"
rm $livre.html
rm $livre.epub
rm $livre.odt
rm $livre.pdf
echo "create html5 " $livre.html
#asciidoctor -a toc --attribute stylesheet=asciidoctor.css $livre.adoc
#no toc
asciidoctor --attribute stylesheet=asciidoctor.css $livre.adoc
#exit
echo "create epub " $livre.epub
 
pandoc -s $livre.html -t epub3 -o $livre.epub
echo "create pdf " $livre.pdf
pandoc -c print.css $livre.html --variable=fontfamily:arev --latex-engine=xelatex -o $livre.pdf
 
echo "create odt " $livre.odt
pandoc  --base-header-level=3 -V date:"" -V title:"" -f html $livre.html -o $livre.odt
#!/usr/bin/bash
 
#make some global cleanings
sed -i 's|oe|œ|g' *.adoc
#exit
livre=radioaktif
 
echo "destroy old versions"
rm $livre.html
rm $livre.epub
rm $livre.odt
rm $livre.pdf
echo "create html5 " $livre.html
#asciidoctor -a toc --attribute stylesheet=asciidoctor.css $livre.adoc
#no toc
asciidoctor --attribute stylesheet=asciidoctor.css book.adoc
cp book.html $livre.html
#exit
echo "create epub " $livre.epub
sed -i 's|<img src="images.*||g' book.html
pandoc -s book.html -t epub3 -o $livre.epub
rm book.html
ebook-convert $livre.html  $livre.2.epub  --pretty-print
 
 
asciidoctor-epub3 -D ./ book.adoc
echo "create pdf " $livre.pdf
#pandoc $livre.html --variable=fontfamily:arev --latex-engine=xelatex --toc -o $livre.pdf
#pandoc -c print.css $livre.html --variable=fontfamily:arev -f fb2 --latex-engine=xelatex -o $livre.pdf
#pandoc -c print.css $livre.html --variable=fontfamily:arev --latex-engine=xelatex -o $livre.pdf
#pandoc -s -c print.css -o $livre.pdf $livre.html
#ebook-convert $livre.html  $livre.pdf --custom-size 110x118 --pdf-default-font-size 11  --pdf-page-margin-bottom 15 --pdf-page-margin-top 15 --pdf-page-margin-left 15 --pdf-page-margin-right 15  --pdf-page-numbers --pdf-sans-family FreeSans  --pdf-serif-family FreeSerif --pdf-standard-font FreeSerif --pretty-print
ebook-convert $livre.html  $livre.pdf  --pretty-print
 
echo "create odt " $livre.odt
#pandoc  --reference-docx=reference.odt --base-header-level=3 -V date:"" -V title:"" -f html $livre.html -o $livre.odt
pandoc  -c asciidoctor.css -f html $livre.html -o $livre.odt
 
#asciidoctor --attribute stylesheet=asciidoctor.css preprint.adoc
#pandoc  preprint.html --reference-odt=/home/radeff/ebooks/polars/Radeff_Fred_polars/modele_publication_moinsdecent.net.ott -o preprint.odt
#!/usr/bin/bash
echo "créé version A4 imprimable avec essai de césure: book.pdf"
asciidoctor -r asciidoctor-pdf -b pdf -a pdf-themesdir=resources/themes -a pdf-theme=moinsdecentA4.yml -a pdf-fontsdir=resources/fonts -a reference-location=block -a scripts=cjk book.adoc --trace
#exit
echo "créé version poche imprimable: bookprint.pdf"
asciidoctor -r asciidoctor-pdf -b pdf -a pdf-themesdir=resources/themes -a pdf-theme=moinsdecent.yml -a pdf-fontsdir=resources/fonts -a reference-location=block -a scripts=cjk bookprint.adoc --trace
 
zathura bookprint.pdf book.pdf&
  • info/asciidoc/bashscript.txt
  • Dernière modification: 2020/03/14 12:19
  • de radeff