summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorAntoine Ouvrard <antoine.ouvrard@nereide.fr>2022-02-07 19:56:57 +0100
committerAntoine Ouvrard <antoine.ouvrard@nereide.fr>2022-02-07 19:56:57 +0100
commit1318db6b75890849cc4a184a9a6e9f2d123da7ee (patch)
tree290db28c3fd4e479e2e9dad25a5a76a797ef44bc /build.sh
parentfa22eff802005e2b7e62441697fe1b3ad6bfbaa4 (diff)
nettoyage du dépot + maj du cv
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh39
1 files changed, 7 insertions, 32 deletions
diff --git a/build.sh b/build.sh
index 4ce0ffa..971980e 100755
--- a/build.sh
+++ b/build.sh
@@ -1,35 +1,10 @@
#!/bin/bash
-while [ -n "$1" ]; do # gestion des paramètres
- case "$1" in
- -h) echo "
-Script qui transforme des fichiers markdown html.
-"
- exit 0;;
- esac
- shift
-done
+# Commande pandoc qui transforme un fichier markdown (example.md)
+# en appliquant une css du même nom (example.css)
-set -e
-IN_DIR="./input-cv-md"
-OUT_DIR="./output"
-STYLES_DIR="styles"
-STYLE="aou"
+pandoc --standalone --css $1.css \
+ --from markdown --to html \
+ --output ./index.html $1.md \
+ --metadata pagetitle=$1;
-# 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'`;
- mkdir -p $OUT_DIR/$FILE_NAME;
-
- pandoc --standalone --css ../../$STYLES_DIR/$STYLE.css \
- --from markdown --to html \
- --output $OUT_DIR/$FILE_NAME/index.html $f \
- --metadata pagetitle=$FILE_NAME;
-
- echo "### Transfmormation du Markdown $IN_DIR/$FILE_NAME.md en HTML dans $OUT_DIR/$FILE_NAME/"
-done \ No newline at end of file
+echo "### Transformation du Markdown $1.md en HTML"