Skip to content

jai-python3/simple-template-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-template-toolkit

Simple templating for all your simple templating projects

Improvements

Please see the TODO for a list of upcoming improvements.

Use Cases

Use Cases diagram

Class Diagrams

class diagrams

Installation

Please see the INSTALL guide for instructions.

Usage

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.

Exported scripts

The following exported console script is available for use:

  • make-substitutions
  • insert-lines

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

To-Do/Coming Next

Please view the listing of planned improvements here.

CHANGELOG

Please view the CHANGELOG here.

License

GNU AFFERO GENERAL PUBLIC LICENSE

About

Simple templating for all your simple templating projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published