Dynamically Processing HTML Templates in V: Seeking Guidance on Compiler Modules Usage #20324
Unanswered
GGRei
asked this question in
Questions and Answers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello V Community,
I'm currently exploring the use of V's compiler modules as a library for processing HTML templates with embedded template directives. My objective is to dynamically generate and return these templates as text. However, I've encountered some confusion regarding the proper sequence of functions and their roles in this process.
My primary question revolves around the utilization of compile_template_file(). Should this function be the initial step in the process, with its output then being fed into parser.parse_comptime()? Following this, should the result be passed through the checker and finally gen, so on?
I'm uncertain about the exact workflow and whether this approach is correct.
I'm using Vweb, integrating a dynamic HTML template management and a caching system directly into the module ( this is already integrated ). The goal is to automate the handling of directives, variable inclusions, and other elements that compile_template_file() does not fully process, as it often transforms them into "$xxx" placeholders.
Additionally, functions like parse_text() seem to require a file path, which adds to my confusion regarding their role in this process.
In summary :
Are there any specific considerations or steps I should be aware of when using these compiler modules for HTML template processing?
Thank you for your time, assistance and this fabulous project that is Vlang!
Beta Was this translation helpful? Give feedback.
All reactions