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
-----------

View file

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

View file

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

View file

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

Binary file not shown.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,2 @@
---
title = 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 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;