matcal.core.file_modifications

Functions

jinja2_processor(contents, replacements)

process_template_file(file_path, replacements)

set_jinja_delimiters([variable, block, ...])

Set the delimiters for Jinja2 templates.

use_jinja_preprocessor()

Forces the preprocessor for templated files to return to the default processor, jinja2.

Classes

jinja2_delimiters()

matcal.core.file_modifications.set_jinja_delimiters(variable='{{ }}', block='{% %}', comment='{# #}', line_statement_prefix=None, line_comment_prefix=None)[source]

Set the delimiters for Jinja2 templates.

Parameters:
  • variable (str) – The delimiter for variables. It should be a single string of the form where the start and end delimiter strings are separated by a space.

  • block (str) – The delimiter for blocks.It should be a single string of the form where the start and end delimiter strings are separated by a space.

  • comment (str) – The delimiter for comments. It should be a single string of the form where the start and end delimiter strings are separated by a space.

  • line_statement_prefix (str) – Optional prefix for line statements.

  • line_comment_prefix (str) – Optional prefix for line comments.

matcal.core.file_modifications.use_jinja_preprocessor()[source]

Forces the preprocessor for templated files to return to the default processor, jinja2.