2022-07-27 14:54:44 +09:00
|
|
|
module template
|
|
|
|
|
2022-07-31 20:16:16 +09:00
|
|
|
pub fn parse(template string, target map[string]string) string {
|
|
|
|
mut content := template
|
|
|
|
for key in target.keys() {
|
|
|
|
at_key := '@' + key
|
|
|
|
value := target[key]
|
|
|
|
// assign to content
|
|
|
|
content = content.replace(at_key, value)
|
|
|
|
}
|
|
|
|
return content
|
2022-07-30 02:24:29 +09:00
|
|
|
}
|