I am currently working on a project were I need to be able to handle text in a trivial way.
In order to do this I made a simple construct in python for this, you can have a look at the implementation here text_manipulation.py
Here follows an example of how this could be used:
T is first assigned
indented_block to make things easier to type.
Then a program template is created where we have two markers,
We also create a template for c functions named
In the example we replace
¶includes with a list of
T("#include <file>") replacing
file with the actual filenames. Then we define the body of the
main function. We finally use the
replace_kw function that will perform several replacements, one for each keyword argument.
function template we can create out
main function and also match indent level.
And here is the output of the program: