From e43bad85b53ee6c236adc32e6ea8a74adeb1df17 Mon Sep 17 00:00:00 2001 From: "uni@bor.mac" Date: Tue, 1 Oct 2024 15:51:29 +0200 Subject: [PATCH] md2verse.sh write to stdout --- md2verse.sh | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/md2verse.sh b/md2verse.sh index 2e4fd76..75a4a01 100755 --- a/md2verse.sh +++ b/md2verse.sh @@ -1,8 +1,8 @@ #!/bin/bash -# converts akoaba markdown into tex +# converts aqoaba markdown into tex # TODO -# - formatting scripture https://tex.stackexchange.com/a/652451/264579 -# - do I even need mutliple verse environments? +# - [ ] formatting scripture https://tex.stackexchange.com/a/652451/264579 +# - [ ] do I even need mutliple verse environments? USAGE="""USAGE: $(basename $0) markdown-file""" if [ $# -ne 1 ] ; then echo "$USAGE" && exit 1; fi @@ -11,29 +11,6 @@ INFILE=$1 BASENAME=$(basename "${INFILE%.*}") KEEP_TMP_FILES=0 - -############### -# OLD VERSION # -############### -## translate from pandoc md to latex -#pandoc \ -# -f markdown \ -# ${bname}.md \ -# -t latex \ -# -o ${bname}.tmp1 -## repurpose headings and verbatim -#sed \ -# -e "s/subsection/attrib/" \ -# -e "s/section/poemtitle/" \ -# -e "s/verbatim/verse/" \ -# ${bname}.tmp1 \ -# > ${bname}.tex -## insert verse into empty lines - -################### -# SECOND VERSION # -################### - sed \ 's/^$/\\end{verse}\ \ @@ -58,11 +35,15 @@ pandoc \ -t latex \ -o ${BASENAME}.tmp4 # --wrap=preserve \ +#sed \ +# -e "s/subsection/attrib/" \ +# -e "s/section/poemtitle/" \ +# ${BASENAME}.tmp4 \ +# > ${BASENAME}.tex sed \ -e "s/subsection/attrib/" \ -e "s/section/poemtitle/" \ - ${BASENAME}.tmp4 \ - > ${BASENAME}.tex + ${BASENAME}.tmp4 if ! [[ $KEEP_TMP_FILES -gt 0 ]] then