From b2c8cffc3d3ebc0b3a288467d9b52b7cd07e3b60 Mon Sep 17 00:00:00 2001 From: "uni@bor.mac" Date: Wed, 2 Oct 2024 00:34:27 +0200 Subject: [PATCH] mv conf.sh to verse.conf --- README.md | 11 +++++++---- mkverse.sh | 25 +++++++++++++++++++------ conf.sh => verse.conf | 9 +++++++++ 3 files changed, 35 insertions(+), 10 deletions(-) mode change 100644 => 100755 mkverse.sh rename conf.sh => verse.conf (57%) diff --git a/README.md b/README.md index a7e0a50..dbb31d6 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,18 @@ This LaTeX code needs a wrapper LaTeX script with \usepackage{verse, gmverse} ``` in the preamble and some other features. -The path to markdown files, chapter names and other options can be configured in the `conf.sh` file. -The `config.sh` file is read by `mkverse.sh`. +The path to markdown files, chapter names and other options can be configured in the `verse.conf` file. +The `verse.conf file is read by `mkverse.sh`. --- ## mkverse.sh The `mkverse.sh` script creates a PDF file out of several easy markdown files. -Some options need to be set in `config.sh` file. -`config.sh` might be renamed to `verse.conf`. +Some options need to be set in `vers.conf` file. +A single configuration file can be given to `mkverse.sh` to use instead of `verse.conf`. +``` +cp verse.conf quaderno.conf +./mkverse.sh quaderno.conf --- diff --git a/mkverse.sh b/mkverse.sh old mode 100644 new mode 100755 index 23b4b39..f31aaaa --- a/mkverse.sh +++ b/mkverse.sh @@ -5,12 +5,17 @@ #set -x set -e -CONF="conf.sh" +if [ $# -eq 1 ] +then + CONF=$1 +else +CONF="verse.conf" +fi + TEMPLATE="verse-wrapper-template.tex" CONVERTER="md2verse.sh" if ! [[ -f $CONF ]] ; then echo "$CONF not found! Exiting ..." && exit ; fi -if ! [[ -f $TEMPLATE ]] ; then echo "$TEMPLATE not found! Exiting ..." && exit ; fi if ! [[ -f $CONVERTER ]] ; then echo "$CONVERTER not found! Exiting ..." && exit ; fi if ! [[ -x $CONVERTER ]] ; then echo "$CONVERTER not executable! Exiting ..." && exit ; fi @@ -19,7 +24,7 @@ if ! [[ -x $CONVERTER ]] ; then echo "$CONVERTER not executable! Exiting ..." && WD=$PWD TMPDIR=$(mktemp -d) PATH=$PATH:$WD -pushd $TMPDIR +pushd $TMPDIR > /dev/null # CONVERT MD TO TEX for tex in $( echo $INFILES | grep '.md$' ) @@ -30,7 +35,10 @@ do mkdir -p $(dirname $tex) $CONVERTER $WD/$tex > $( echo $tex | sed "s/.md/.tex/" ) else - echo "$WD/$tex does not exist!!!" + if [[ $tex == *.md ]] + then + echo "$WD/$tex does not exist!!!" + fi fi done @@ -74,7 +82,12 @@ done echo "$WRAPPER_END" >> $PROJECT.tex # CREATE PDF -$LATEX_ENGINE $PROJECT.tex +$LATEX_ENGINE $PROJECT.tex 2&> /dev/null +$LATEX_ENGINE $PROJECT.tex 2&> /dev/null +# $LATEX_ENGINE $PROJECT.tex cp $PROJECT.pdf $WD -popd +echo "File $PROJECT.pdf created at $WD" +#cp $PROJECT.tex $WD +echo "File $PROJECT.tex created at $WD" +popd > /dev/null rm -rf $TMPDIR diff --git a/conf.sh b/verse.conf similarity index 57% rename from conf.sh rename to verse.conf index 8cf329e..0c2ab35 100644 --- a/conf.sh +++ b/verse.conf @@ -10,4 +10,13 @@ Ladainhas testfiles/verse.md Corridos testfiles/verse.md +testfiles/verse.md +testfiles/verse.md +testfiles/verse.md +testfiles/verse.md +testfiles/verse.md +testfiles/verse.md +Corridos +testfiles/verse.md +testfiles/verse.md "