mv conf.sh to verse.conf
This commit is contained in:
parent
f9c5191b7d
commit
b2c8cffc3d
11
README.md
11
README.md
@ -12,15 +12,18 @@ This LaTeX code needs a wrapper LaTeX script with
|
|||||||
\usepackage{verse, gmverse}
|
\usepackage{verse, gmverse}
|
||||||
```
|
```
|
||||||
in the preamble and some other features.
|
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 path to markdown files, chapter names and other options can be configured in the `verse.conf` file.
|
||||||
The `config.sh` file is read by `mkverse.sh`.
|
The `verse.conf file is read by `mkverse.sh`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## mkverse.sh
|
## mkverse.sh
|
||||||
The `mkverse.sh` script creates a PDF file out of several easy markdown files.
|
The `mkverse.sh` script creates a PDF file out of several easy markdown files.
|
||||||
Some options need to be set in `config.sh` file.
|
Some options need to be set in `vers.conf` file.
|
||||||
`config.sh` might be renamed to `verse.conf`.
|
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
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
25
mkverse.sh
Normal file → Executable file
25
mkverse.sh
Normal file → Executable file
@ -5,12 +5,17 @@
|
|||||||
#set -x
|
#set -x
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
CONF="conf.sh"
|
if [ $# -eq 1 ]
|
||||||
|
then
|
||||||
|
CONF=$1
|
||||||
|
else
|
||||||
|
CONF="verse.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
TEMPLATE="verse-wrapper-template.tex"
|
TEMPLATE="verse-wrapper-template.tex"
|
||||||
CONVERTER="md2verse.sh"
|
CONVERTER="md2verse.sh"
|
||||||
|
|
||||||
if ! [[ -f $CONF ]] ; then echo "$CONF not found! Exiting ..." && exit ; fi
|
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 ! [[ -f $CONVERTER ]] ; then echo "$CONVERTER not found! Exiting ..." && exit ; fi
|
||||||
if ! [[ -x $CONVERTER ]] ; then echo "$CONVERTER not executable! 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
|
WD=$PWD
|
||||||
TMPDIR=$(mktemp -d)
|
TMPDIR=$(mktemp -d)
|
||||||
PATH=$PATH:$WD
|
PATH=$PATH:$WD
|
||||||
pushd $TMPDIR
|
pushd $TMPDIR > /dev/null
|
||||||
|
|
||||||
# CONVERT MD TO TEX
|
# CONVERT MD TO TEX
|
||||||
for tex in $( echo $INFILES | grep '.md$' )
|
for tex in $( echo $INFILES | grep '.md$' )
|
||||||
@ -30,7 +35,10 @@ do
|
|||||||
mkdir -p $(dirname $tex)
|
mkdir -p $(dirname $tex)
|
||||||
$CONVERTER $WD/$tex > $( echo $tex | sed "s/.md/.tex/" )
|
$CONVERTER $WD/$tex > $( echo $tex | sed "s/.md/.tex/" )
|
||||||
else
|
else
|
||||||
echo "$WD/$tex does not exist!!!"
|
if [[ $tex == *.md ]]
|
||||||
|
then
|
||||||
|
echo "$WD/$tex does not exist!!!"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -74,7 +82,12 @@ done
|
|||||||
echo "$WRAPPER_END" >> $PROJECT.tex
|
echo "$WRAPPER_END" >> $PROJECT.tex
|
||||||
|
|
||||||
# CREATE PDF
|
# 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
|
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
|
rm -rf $TMPDIR
|
||||||
|
@ -10,4 +10,13 @@ Ladainhas
|
|||||||
testfiles/verse.md
|
testfiles/verse.md
|
||||||
Corridos
|
Corridos
|
||||||
testfiles/verse.md
|
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
|
||||||
"
|
"
|
Loading…
Reference in New Issue
Block a user