summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh57
-rw-r--r--input-cv-md/antoine.md6
-rw-r--r--output/antoine/index.html (renamed from output/antoine.html)6
3 files changed, 46 insertions, 23 deletions
diff --git a/build.sh b/build.sh
index bbb3a8a..1d21316 100755
--- a/build.sh
+++ b/build.sh
@@ -3,34 +3,57 @@ while [ -n "$1" ]; do # gestion des paramètres
case "$1" in
-h) echo "Script qui transforme des fichiers markdown en pdf et html avec le même style.
-k conserve les fichiers de construction"; exit 0;;
+ --pdf) PDF=true;;
+ --html) HTML=true;;
-k) keep=true;;
esac
shift
done
-set -xe
+# Si on indique aucune consigne on fait la génération en pdf et html
+if [[ -z "$PDF" ]] && [[ -z "$HTML" ]]; then
+ PDF=true
+ HTML=true
+fi
+
+set -e
IN_DIR="./input-cv-md"
OUT_DIR="./output"
STYLES_DIR="styles"
STYLE="aou"
-mkdir -p $IN_DIR
-mkdir -p $OUT_DIR
+# Si il n'y a pas de fichier markdown dans le dossier d'entrée, le script s'arrète
+if [[ ! -d "$IN_DIR" ]] || [[ -z "$(ls -A $IN_DIR/*.md)" ]]; then
+ echo "Attention il n'y a aucun CV en markdown dans le dossier $IN_DIR"
+ exit 1
+fi
for f in $IN_DIR/*.md; do
+
FILE_NAME=`basename $f | sed 's/.md//g'`;
- # Génère le HTML
- pandoc --standalone --css ../$STYLES_DIR/$STYLE.css \
- --from markdown --to html \
- --output $OUT_DIR/$FILE_NAME.html $f \
- --metadata pagetitle=$FILE_NAME;
- # Génère le PDF
- pandoc --standalone --template $STYLES_DIR/$STYLE.tex \
- --from markdown --to context --variable papersize=A4 \
- --output $OUT_DIR/$FILE_NAME.tex $f;
- mtxrun --path=$OUT_DIR --result=$FILE_NAME.pdf --script context $FILE_NAME.tex;
-done
+ mkdir -p $OUT_DIR/$FILE_NAME;
-if [ -z "$keep" ] ; then
- rm -rf $OUT_DIR/*.log $OUT_DIR/*.tex $OUT_DIR/*.tuc styles/*.pdf;
-fi
+ if [[ $HTML ]]; then
+ echo "### Génération du HTML"
+ pandoc --standalone --css ../../$STYLES_DIR/$STYLE.css \
+ --from markdown --to html \
+ --output $OUT_DIR/$FILE_NAME/index.html $f \
+ --metadata pagetitle=$FILE_NAME;
+ fi
+
+ if [[ $PDF ]]; then
+ echo "### Génération du PDF"
+ pandoc --standalone --template $STYLES_DIR/$STYLE.tex \
+ --from markdown --to context --variable papersize=A4 \
+ --output $OUT_DIR/$FILE_NAME/$FILE_NAME.tex $f;
+ mtxrun --path=$OUT_DIR --result=$FILE_NAME/cv-$FILE_NAME.pdf --script context $FILE_NAME.tex;
+ fi
+
+ # Néttoie les fichiers de génération
+ if [ -z "$keep" ] ; then
+ rm -rf $OUT_DIR/$FILE_NAME/*.log $OUT_DIR/$FILE_NAME/*.tex $OUT_DIR/$FILE_NAME/*.tuc;
+ fi
+
+ echo "### Fin du script"
+
+done
diff --git a/input-cv-md/antoine.md b/input-cv-md/antoine.md
index 62ef353..de4b75e 100644
--- a/input-cv-md/antoine.md
+++ b/input-cv-md/antoine.md
@@ -21,7 +21,7 @@ depuis 2014
2012 à 2014
: **Fondateur d'une association informatique et solidaire**
-*CALIS https://www.calis-asso.org/ - Cholet (49) - Bénévolat*
+*CALIS https://www.calis-asso.org - Cholet (49) - Bénévolat*
• **Rencontre d'acteurs** politiques, associatifs, collectivitées - Recherche de subventions
• Animation d'atelier de **formation** - Promotion du logiciel libre
• Recherche et mise en place d'un **système GNU/Linux** personnalisé - Clonnage de PC
@@ -33,10 +33,10 @@ depuis 2014
### Compétences
-Systèmes
+Sys.
: GNU/Linux - Serveur Web - Git - Gitlab/CI - Ansible - Grafana - Jenkins - Postgres
-Language
+Lang.
: Java - XML - HTML - Groovy - YAML
### Formation
diff --git a/output/antoine.html b/output/antoine/index.html
index 441f471..e70ef67 100644
--- a/output/antoine.html
+++ b/output/antoine/index.html
@@ -36,7 +36,7 @@
</dd>
<dt>2012 à 2014</dt>
<dd><strong>Fondateur d’une association informatique et solidaire</strong><br />
-<em>CALIS https://www.calis-asso.org/ - Cholet (49) - Bénévolat</em><br />
+<em>CALIS https://www.calis-asso.org - Cholet (49) - Bénévolat</em><br />
• <strong>Rencontre d’acteurs</strong> politiques, associatifs, collectivitées - Recherche de subventions<br />
• Animation d’atelier de <strong>formation</strong> - Promotion du logiciel libre<br />
• Recherche et mise en place d’un <strong>système GNU/Linux</strong> personnalisé - Clonnage de PC
@@ -49,10 +49,10 @@
</dl>
<h3 id="compétences">Compétences</h3>
<dl>
-<dt>Systèmes</dt>
+<dt>Sys.</dt>
<dd>GNU/Linux - Serveur Web - Git - Gitlab/CI - Ansible - Grafana - Jenkins - Postgres
</dd>
-<dt>Language</dt>
+<dt>Lang.</dt>
<dd>Java - XML - HTML - Groovy - YAML
</dd>
</dl>