mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: impl of comptime tmpl parsing (fix vweb_example)
This commit is contained in:
@ -34,7 +34,9 @@ pub fn compile_template(content string) string {
|
||||
mut s := strings.new_builder(1000)
|
||||
// base := path.all_after_last('/').replace('.html', '')
|
||||
s.writeln("
|
||||
import strings
|
||||
// === vweb html template ===
|
||||
fn vweb_tmpl() {
|
||||
mut sb := strings.new_builder(${lines.len * 30})
|
||||
header := \' \' // TODO remove
|
||||
_ = header
|
||||
@ -90,6 +92,7 @@ pub fn compile_template(content string) string {
|
||||
}
|
||||
s.writeln(str_end)
|
||||
s.writeln('tmpl_res := sb.str() ')
|
||||
s.writeln('}')
|
||||
s.writeln('// === end of vweb html template ===')
|
||||
return s.str()
|
||||
}
|
||||
|
Reference in New Issue
Block a user