fixed docs

This commit is contained in:
snarmph 2024-12-02 19:11:30 +01:00
parent a92b119549
commit 4efb77ea9b
27 changed files with 8 additions and 87 deletions

View file

@ -1,6 +1,3 @@
---
title = Arena
---
# Arena # Arena
----------- -----------

View file

@ -1,6 +1,3 @@
---
title = Base 64
---
# Base 64 # Base 64
---------- ----------

View file

@ -1,6 +1,3 @@
---
title = Threads
---
# Threads # Threads
---------- ----------

View file

@ -1,6 +1,3 @@
---
title = Dir
---
# Dir # Dir
---------- ----------

Binary file not shown.

View file

@ -1,6 +1,3 @@
---
title = File
---
# File # File
---------- ----------

View file

@ -1,6 +1,3 @@
---
title = Format
---
# Format # Format
---------- ----------

View file

@ -1,6 +1,3 @@
---
title = Highlight
---
# Highlight # Highlight
---------- ----------

View file

@ -1,6 +1,3 @@
---
title = Hot Reload
---
# Hot Reload # Hot Reload
---------- ----------

View file

@ -1,6 +1,3 @@
---
title = HTML
---
# HTML # HTML
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = HTTP
---
# HTTP # HTTP
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = Ini
---
# Ini # Ini
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = Json
---
# Json # Json
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = Markdown
---
# Markdown # Markdown
---------- ----------

View file

@ -1,5 +1,4 @@
--- # Colla
title = Readme
---
# Readme
---------- ----------
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.

View file

@ -1,5 +1,2 @@
---
title = Server
---
# Server # Server
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = SHA-1
---
# SHA-1 # SHA-1
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = Socket
---
# Socket # Socket
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = Str
---
# Str # Str
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = StrStream
---
# StrStream # StrStream
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = Tracelog
---
# Tracelog # Tracelog
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = UTF-8
---
# UTF-8 # UTF-8
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = Vec
---
# Vec # Vec
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = VMem
---
# VMem # VMem
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = WebSocket
---
# WebSocket # WebSocket
---------- ----------

View file

@ -1,5 +1,2 @@
---
title = Xml
---
# Xml # Xml
---------- ----------

View file

@ -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 fullname = strFmt(&scratch, "%v/%v", path, entry->name);
str_t markdown_str = fileReadWholeStr(&scratch, strv(fullname)); str_t markdown_str = fileReadWholeStr(&scratch, strv(fullname));
ini_t config = {0};
str_t md = markdownStr(&scratch, strv(markdown_str), &(md_options_t){ str_t md = markdownStr(&scratch, strv(markdown_str), &(md_options_t){
.out_config = &config,
.parsers = (md_parser_t[]){ .parsers = (md_parser_t[]){
{ {
.init = md_cparser_init, .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, .parsers_count = 1,
}); });
inivalue_t *title = iniGet(iniGetTable(&config, INI_ROOT), strv("title"));
page_t *page = alloc(arena, page_t); page_t *page = alloc(arena, page_t);
page->data = md; page->data = md;
page->url = str(arena, name); page->url = str(arena, name);
if (title) { usize line_end = strvFind(strv(markdown_str), '\n', 0);
page->title = str(arena, title->value); strview_t line = strvSub(strv(markdown_str), 0, line_end);
} strview_t page_title = strvTrim(strvRemovePrefix(line, 1));
else { page->title = strFmt(arena, "%v", page_title);
page->title = page->url;
}
if (!first && strvEquals(name, default_page)) { if (!first && strvEquals(name, default_page)) {
first = page; first = page;