Compare commits
3 Commits
44cecf02e8
...
437fe17db0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
437fe17db0 | ||
|
|
4d0f58e5b0 | ||
|
|
b49cb5ad27 |
33
main.odin
33
main.odin
@ -66,25 +66,22 @@ main :: proc() {
|
|||||||
|
|
||||||
switch trimmed_filename {
|
switch trimmed_filename {
|
||||||
case "index":
|
case "index":
|
||||||
buf: [1024]u8
|
defer {
|
||||||
date := time.now()
|
buf: [1024]u8
|
||||||
end := time.tick_since(start)
|
date := time.now()
|
||||||
|
end := time.tick_since(start)
|
||||||
os.write_string(file, "<br><footer><hr />This site was generated με αγάπη on ")
|
|
||||||
os.write_string(
|
|
||||||
file,
|
|
||||||
fmt.aprintf("%s ", time.to_string_dd_mm_yy(date, buf[:]), allocator = arena_alloc),
|
|
||||||
)
|
|
||||||
os.write_string(
|
|
||||||
file,
|
|
||||||
fmt.aprintf(
|
|
||||||
"in %v ",
|
|
||||||
time.duration_round(end, time.Nanosecond),
|
|
||||||
allocator = arena_alloc,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
os.write_string(file, "<font color=#ea76cb><3</font> </footer><br>")
|
|
||||||
|
|
||||||
|
os.write_string(file, "<br><footer><hr />This site was generated με αγάπη on ")
|
||||||
|
os.write_string(
|
||||||
|
file,
|
||||||
|
fmt.aprintf("%s ", time.to_string_dd_mm_yy(date, buf[:]), allocator = arena_alloc),
|
||||||
|
)
|
||||||
|
os.write_string(
|
||||||
|
file,
|
||||||
|
fmt.aprintf("in %v ", time.duration_round(end, time.Nanosecond), allocator = arena_alloc),
|
||||||
|
)
|
||||||
|
os.write_string(file, "<font color=#ea76cb><3</font> </footer><br>")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
odinfmt.json
Normal file
10
odinfmt.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"character_width": 120,
|
||||||
|
"tabs": true,
|
||||||
|
"tabs_width": 4,
|
||||||
|
"sort_imports": true,
|
||||||
|
"spaces_around_colons": false,
|
||||||
|
"align_struct_fields": true,
|
||||||
|
"align_struct_values": true,
|
||||||
|
"space_single_line_blocks": true
|
||||||
|
}
|
||||||
13
parse.odin
13
parse.odin
@ -21,10 +21,7 @@ write_prefixs_to_html_file :: proc(file: ^os.File) {
|
|||||||
os.write_string(file, MASTODON_PREFIX)
|
os.write_string(file, MASTODON_PREFIX)
|
||||||
}
|
}
|
||||||
|
|
||||||
walk_tree_and_get_md_names :: proc(
|
walk_tree_and_get_md_names :: proc(path: string, allocator := context.allocator) -> [dynamic]string {
|
||||||
path: string,
|
|
||||||
allocator := context.allocator,
|
|
||||||
) -> [dynamic]string {
|
|
||||||
|
|
||||||
files := make([dynamic]string, allocator)
|
files := make([dynamic]string, allocator)
|
||||||
|
|
||||||
@ -82,13 +79,7 @@ walk_tree :: proc(path: string) -> []u8 {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_file_md_to_html :: proc(
|
parse_file_md_to_html :: proc(filename: string, allocator := context.allocator) -> (parsed: string, err: os.Error) {
|
||||||
filename: string,
|
|
||||||
allocator := context.allocator,
|
|
||||||
) -> (
|
|
||||||
parsed: string,
|
|
||||||
err: os.Error,
|
|
||||||
) {
|
|
||||||
str := os.read_entire_file_from_path(filename, allocator) or_return
|
str := os.read_entire_file_from_path(filename, allocator) or_return
|
||||||
|
|
||||||
root := cm.parse_document(raw_data(str), len(str), cm.DEFAULT_OPTIONS)
|
root := cm.parse_document(raw_data(str), len(str), cm.DEFAULT_OPTIONS)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user