r/AskProgramming • u/spaceursa • Apr 13 '26
Easiest way to create a text template generator?
I think I'm wording this wrong and that's why I couldn't find anything while googling, but I'm trying to create something that would have a base text template with areas to fill out, and once all sections are filled out (or you press done), it generates a copy/paste version of everything you just filled out. Is this possible?
Edit: Would need it to not be web-based as I'm working with sensitive info.
1
Upvotes
2
u/theavatare Apr 13 '26
You can put a form on a template engine like razor or ninja and get that done
2
u/KingofGamesYami Apr 13 '26
There's tons of templating engines out there. Jinja is really popular, as is Pug. Really depends what you're after I guess.
1
u/AlexTaradov Apr 13 '26
It is not clear what you want at all. It sounds like maybe a PDF file with form fields would work.
Otherwise, all the things suggested so far can run locally. No need to put anything online.
1
u/Groundbreaking-Fish6 Apr 13 '26
Actually this is what XML is for. Create a data definition file XSD then use an XSLT to transform it into anything you like. Yes I did do this with sensitive data years ago. A little JavaScript goes a long way to make it dynamic e.g. open and close details.
1
u/seanrowens Apr 14 '26
Maybe google m4, it's kind of like the cpp macro processor on steroids.