Simple templating for all your simple templating projects
Please see the TODO for a list of upcoming improvements.
Please see the INSTALL guide for instructions.
Use Case 1:
from simple_template_toolkit import STTManager
tm = STTManager()
tm.make_substitutions(
template_file=template_file, # the template file containing your placeholder values
outfile=outfile, # the file that should be written out
lookup=lookup # a dictionary contain placeholders for keys and corresponding values replace with
)
Use Case 2:
from simple_template_toolkit import STTManager
tm = STTManager()
tm.inject_lines(
template_file=template_file, # the template file containing your placeholder values
outfile=outfile, # the file that should be written out
lookup=lookup
)
# The lookup is a dictionary where the keys are
# are the line anchors where the lines of code should be inserted.
# The values are lists (arrays) containing the lines of code that
# should be inserted at that line anchor.
The following exported console script is available for use:
- make-substitutions
- insert-lines
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please view the listing of planned improvements here.
Please view the CHANGELOG here.