diff --git a/docs/arena.md b/docs/arena.md index fa450e8..438b390 100644 --- a/docs/arena.md +++ b/docs/arena.md @@ -1,6 +1,3 @@ ---- -title = Arena ---- # Arena ----------- diff --git a/docs/base64.md b/docs/base64.md index 46128bd..e238648 100644 --- a/docs/base64.md +++ b/docs/base64.md @@ -1,6 +1,3 @@ ---- -title = Base 64 ---- # Base 64 ---------- diff --git a/docs/cthreads.md b/docs/cthreads.md index 3f4e1ef..fee03d9 100644 --- a/docs/cthreads.md +++ b/docs/cthreads.md @@ -1,6 +1,3 @@ ---- -title = Threads ---- # Threads ---------- diff --git a/docs/dir.md b/docs/dir.md index 35cdb4e..ea481da 100644 --- a/docs/dir.md +++ b/docs/dir.md @@ -1,6 +1,3 @@ ---- -title = Dir ---- # Dir ---------- diff --git a/docs/docs.com b/docs/docs.com index 0f45b2c..3bdaaf4 100644 Binary files a/docs/docs.com and b/docs/docs.com differ diff --git a/docs/file.md b/docs/file.md index 8caf554..79abefa 100644 --- a/docs/file.md +++ b/docs/file.md @@ -1,6 +1,3 @@ ---- -title = File ---- # File ---------- diff --git a/docs/format.md b/docs/format.md index 18ab65d..2afd810 100644 --- a/docs/format.md +++ b/docs/format.md @@ -1,6 +1,3 @@ ---- -title = Format ---- # Format ---------- diff --git a/docs/highlight.md b/docs/highlight.md index 2356571..42edc70 100644 --- a/docs/highlight.md +++ b/docs/highlight.md @@ -1,6 +1,3 @@ ---- -title = Highlight ---- # Highlight ---------- diff --git a/docs/hot_reload.md b/docs/hot_reload.md index ba173ff..65a59b5 100644 --- a/docs/hot_reload.md +++ b/docs/hot_reload.md @@ -1,6 +1,3 @@ ---- -title = Hot Reload ---- # Hot Reload ---------- diff --git a/docs/html.md b/docs/html.md index 7dbef59..873736d 100644 --- a/docs/html.md +++ b/docs/html.md @@ -1,6 +1,3 @@ ---- -title = HTML ---- # HTML ---------- diff --git a/docs/http.md b/docs/http.md index b783135..95f751c 100644 --- a/docs/http.md +++ b/docs/http.md @@ -1,5 +1,2 @@ ---- -title = HTTP ---- # HTTP ---------- \ No newline at end of file diff --git a/docs/ini.md b/docs/ini.md index b854f8f..62590b6 100644 --- a/docs/ini.md +++ b/docs/ini.md @@ -1,5 +1,2 @@ ---- -title = Ini ---- # Ini ---------- \ No newline at end of file diff --git a/docs/json.md b/docs/json.md index 597d70d..e529cd9 100644 --- a/docs/json.md +++ b/docs/json.md @@ -1,5 +1,2 @@ ---- -title = Json ---- # Json ---------- \ No newline at end of file diff --git a/docs/markdown.md b/docs/markdown.md index cd5c5a4..f65eab2 100644 --- a/docs/markdown.md +++ b/docs/markdown.md @@ -1,5 +1,2 @@ ---- -title = Markdown ---- # Markdown ---------- \ No newline at end of file diff --git a/docs/readme.md b/docs/readme.md index 3d9e0bb..ce9fbcc 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,5 +1,4 @@ ---- -title = Readme ---- -# Readme ----------- \ No newline at end of file +# Colla +---------- + +Colla is a library that I use personally for all my C projects. It doesn't have one specific purpose, but more a collection of useful things that I've written. \ No newline at end of file diff --git a/docs/server.md b/docs/server.md index 0644960..61d57d2 100644 --- a/docs/server.md +++ b/docs/server.md @@ -1,5 +1,2 @@ ---- -title = Server ---- # Server ---------- \ No newline at end of file diff --git a/docs/sha1.md b/docs/sha1.md index 5c841fc..f9f2ba1 100644 --- a/docs/sha1.md +++ b/docs/sha1.md @@ -1,5 +1,2 @@ ---- -title = SHA-1 ---- # SHA-1 ---------- \ No newline at end of file diff --git a/docs/socket.md b/docs/socket.md index 5e2673d..6188d75 100644 --- a/docs/socket.md +++ b/docs/socket.md @@ -1,5 +1,2 @@ ---- -title = Socket ---- # Socket ---------- \ No newline at end of file diff --git a/docs/str.md b/docs/str.md index 2cd845a..375e85d 100644 --- a/docs/str.md +++ b/docs/str.md @@ -1,5 +1,2 @@ ---- -title = Str ---- # Str ---------- \ No newline at end of file diff --git a/docs/strstream.md b/docs/strstream.md index 0036108..e619e1d 100644 --- a/docs/strstream.md +++ b/docs/strstream.md @@ -1,5 +1,2 @@ ---- -title = StrStream ---- # StrStream ---------- \ No newline at end of file diff --git a/docs/tracelog.md b/docs/tracelog.md index ea047b2..0d12d1f 100644 --- a/docs/tracelog.md +++ b/docs/tracelog.md @@ -1,5 +1,2 @@ ---- -title = Tracelog ---- # Tracelog ---------- \ No newline at end of file diff --git a/docs/utf8.md b/docs/utf8.md index 57ba1e0..5a15b43 100644 --- a/docs/utf8.md +++ b/docs/utf8.md @@ -1,5 +1,2 @@ ---- -title = UTF-8 ---- # UTF-8 ---------- \ No newline at end of file diff --git a/docs/vec.md b/docs/vec.md index 22bc964..7500a52 100644 --- a/docs/vec.md +++ b/docs/vec.md @@ -1,5 +1,2 @@ ---- -title = Vec ---- # Vec ---------- \ No newline at end of file diff --git a/docs/vmem.md b/docs/vmem.md index b930492..694c7e2 100644 --- a/docs/vmem.md +++ b/docs/vmem.md @@ -1,5 +1,2 @@ ---- -title = VMem ---- # VMem ---------- \ No newline at end of file diff --git a/docs/websocket.md b/docs/websocket.md index 7fa5f6f..f590eb5 100644 --- a/docs/websocket.md +++ b/docs/websocket.md @@ -1,5 +1,2 @@ ---- -title = WebSocket ---- # WebSocket ---------- \ No newline at end of file diff --git a/docs/xml.md b/docs/xml.md index d6bbafb..493d0f9 100644 --- a/docs/xml.md +++ b/docs/xml.md @@ -1,5 +1,2 @@ ---- -title = Xml ---- # Xml ---------- \ No newline at end of file diff --git a/tools/docs.c b/tools/docs.c index c8eb9e3..9c5f928 100644 --- a/tools/docs.c +++ b/tools/docs.c @@ -91,9 +91,7 @@ page_t *get_pages(arena_t *arena, strview_t path, strview_t default_page) { str_t fullname = strFmt(&scratch, "%v/%v", path, entry->name); str_t markdown_str = fileReadWholeStr(&scratch, strv(fullname)); - ini_t config = {0}; str_t md = markdownStr(&scratch, strv(markdown_str), &(md_options_t){ - .out_config = &config, .parsers = (md_parser_t[]){ { .init = md_cparser_init, @@ -105,18 +103,14 @@ page_t *get_pages(arena_t *arena, strview_t path, strview_t default_page) { .parsers_count = 1, }); - inivalue_t *title = iniGet(iniGetTable(&config, INI_ROOT), strv("title")); - page_t *page = alloc(arena, page_t); page->data = md; page->url = str(arena, name); - if (title) { - page->title = str(arena, title->value); - } - else { - page->title = page->url; - } + usize line_end = strvFind(strv(markdown_str), '\n', 0); + strview_t line = strvSub(strv(markdown_str), 0, line_end); + strview_t page_title = strvTrim(strvRemovePrefix(line, 1)); + page->title = strFmt(arena, "%v", page_title); if (!first && strvEquals(name, default_page)) { first = page;