Skip to content

Commit 3f20d6c

Browse files
committed
Removed the SASS step from the build process. The index from section names and files is stored in the same v-doc.js file instead of a separate file. Items are stored under the vdocs namespace instead of global variables.
1 parent 2e20650 commit 3f20d6c

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

main.v

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ fn main() {
2020
commit_res := os.execute_or_exit('git ls-remote -h https://github.com/vlang/v.git refs/heads/master')
2121
latest_v_commit_hash := commit_res.output.all_before('\t')
2222

23-
update_sass()
23+
//Removed need for sass, using css variables
24+
//update_sass()
2425

2526
mut ctx := Context{
2627
full_text: response.body
@@ -39,11 +40,18 @@ mut:
3940
}
4041

4142
fn (mut ctx Context) write_mapping() ! {
42-
content := '
43-
const titles_to_fnames = ${json.encode_pretty(ctx.titles_to_fnames)};
44-
const fnames = ${json.encode_pretty(ctx.pages)};
45-
'
46-
write_output_file('assets/scripts/titles_to_fnames.js', content)!
43+
js_file_index := '
44+
// Lookups of sections to files
45+
vdocs.titles_to_fnames = ${json.encode_pretty(ctx.titles_to_fnames)};
46+
vdocs.fnames = ${json.encode_pretty(ctx.pages)};'
47+
48+
js_src := os.read_file('templates/assets/scripts/v-docs.js') or {
49+
eprintln('Failed to read file: $err')
50+
return
51+
}
52+
53+
write_output_file('assets/scripts/v-docs.js', js_src + js_file_index)!
54+
4755
eprintln('> Total titles: ${ctx.titles_to_fnames.len}')
4856
eprintln('> HTML pages: ${ctx.pages.len}')
4957
}

sass.v

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)