🚧
This commit is contained in:
parent
2fedc8a90f
commit
b1405723cc
1 changed files with 8 additions and 4 deletions
12
vss.v
12
vss.v
|
@ -54,12 +54,15 @@ fn get_html_filename(md_path string) string {
|
||||||
return file_name + '.html'
|
return file_name + '.html'
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse_link convert markdown relative links to html relative links
|
// pre_proc_md_to_html convert markdown relative links to html relative links
|
||||||
fn parse_link(contents string) string {
|
fn pre_proc_md_to_html(contents string) string {
|
||||||
lines := contents.split_into_lines()
|
lines := contents.split_into_lines()
|
||||||
for line in lines {
|
mut parsed_lines := []string{len: lines.len}
|
||||||
|
for i, iine in contents.split_into_lines() {
|
||||||
println(line)
|
println(line)
|
||||||
|
parsed_lines[i] = line
|
||||||
}
|
}
|
||||||
|
return parsed_lines.join("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generate_pages() ? {
|
fn generate_pages() ? {
|
||||||
|
@ -73,7 +76,8 @@ fn generate_pages() ? {
|
||||||
|
|
||||||
md_paths := get_paths('.')
|
md_paths := get_paths('.')
|
||||||
for path in md_paths {
|
for path in md_paths {
|
||||||
md := os.read_file(path)?
|
mut md := os.read_file(path)?
|
||||||
|
md = pre_proc_md_to_html(md)
|
||||||
contents := markdown.to_html(md)
|
contents := markdown.to_html(md)
|
||||||
config_map['contents'] = contents
|
config_map['contents'] = contents
|
||||||
html := template.parse(template_content, config_map)
|
html := template.parse(template_content, config_map)
|
||||||
|
|
Loading…
Add table
Reference in a new issue