remove templater
This commit is contained in:
parent
cc46c8779f
commit
f77a6175a4
2
Makefile
2
Makefile
@ -53,6 +53,7 @@ ${BUILD_OPUS_DIR}:
|
||||
|
||||
${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
|
||||
rm -r ${SRC_DIR}/tmp_ly
|
||||
|
||||
${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi
|
||||
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
|
||||
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
|
||||
${TMP_BOOK_DIR}/%-octavo.pdf: ${TMP_BOOK_DIR}/%.pdf
|
||||
|
@ -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)
|
Loading…
Reference in New Issue
Block a user