1
0
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:
joe-conigliaro
2020-06-07 20:26:45 +10:00
committed by GitHub
parent 013bfc7ebc
commit 1c2bf7b244
6 changed files with 46 additions and 48 deletions

View File

@ -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()
}