remove templater

This commit is contained in:
Sebastian Hugentobler 2017-11-08 11:11:41 +01:00
parent cc46c8779f
commit f77a6175a4
No known key found for this signature in database
GPG Key ID: 7BBE74D3F626FC0F
2 changed files with 2 additions and 23 deletions

View File

@ -53,6 +53,7 @@ ${BUILD_OPUS_DIR}:
${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex ${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex
cd ${SRC_DIR} && lualatex --jobname='$(notdir $(basename $@))' --output-directory=${WORKING_DIR}/${TMP_SONG_DIR} --shell-escape ${WORKING_DIR}/${SRC_DIR}/song.tex ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).ly ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).tex cd ${SRC_DIR} && lualatex --jobname='$(notdir $(basename $@))' --output-directory=${WORKING_DIR}/${TMP_SONG_DIR} --shell-escape ${WORKING_DIR}/${SRC_DIR}/song.tex ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).ly ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).tex
rm -r ${SRC_DIR}/tmp_ly
${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi ${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi
cp $< $@ cp $< $@
@ -65,6 +66,7 @@ ${BUILD_OPUS_DIR}/%.opus: ${BUILD_MIDI_DIR}/%.midi
${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png ${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png
latexmk -cd -lualatex -e '$$lualatex=q/lualatex %O -shell-escape %S/' -output-directory=${WORKING_DIR}/${TMP_BOOK_DIR} $< latexmk -cd -lualatex -e '$$lualatex=q/lualatex %O -shell-escape %S/' -output-directory=${WORKING_DIR}/${TMP_BOOK_DIR} $<
rm -r ${SRC_DIR}/tmp_ly
#short edge binding #short edge binding
${TMP_BOOK_DIR}/%-octavo.pdf: ${TMP_BOOK_DIR}/%.pdf ${TMP_BOOK_DIR}/%-octavo.pdf: ${TMP_BOOK_DIR}/%.pdf

View File

@ -1,23 +0,0 @@
#! /usr/bin/env python
# encoding: utf-8
import ast
import os
import sys
from jinja2 import Environment, FileSystemLoader, Template
template_dir = os.path.abspath(os.path.dirname(sys.argv[1]))
template_name = os.path.basename(sys.argv[1])
env = Environment(loader=FileSystemLoader(template_dir))
env.block_start_string = '((*'
env.block_end_string = '*))'
env.variable_start_string = '((('
env.variable_end_string = ')))'
env.comment_start_string = '((='
env.comment_end_string = '=))'
template = env.get_template(template_name)
rendered = template.render(ast.literal_eval(sys.argv[2]))
print(rendered)