fixed docs
This commit is contained in:
parent
a92b119549
commit
4efb77ea9b
27 changed files with 8 additions and 87 deletions
|
|
@ -1,6 +1,3 @@
|
||||||
---
|
|
||||||
title = Arena
|
|
||||||
---
|
|
||||||
# Arena
|
# Arena
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
---
|
|
||||||
title = Base 64
|
|
||||||
---
|
|
||||||
# Base 64
|
# Base 64
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
---
|
|
||||||
title = Threads
|
|
||||||
---
|
|
||||||
# Threads
|
# Threads
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
---
|
|
||||||
title = Dir
|
|
||||||
---
|
|
||||||
# Dir
|
# Dir
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
|
||||||
BIN
docs/docs.com
BIN
docs/docs.com
Binary file not shown.
|
|
@ -1,6 +1,3 @@
|
||||||
---
|
|
||||||
title = File
|
|
||||||
---
|
|
||||||
# File
|
# File
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
---
|
|
||||||
title = Format
|
|
||||||
---
|
|
||||||
# Format
|
# Format
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
---
|
|
||||||
title = Highlight
|
|
||||||
---
|
|
||||||
# Highlight
|
# Highlight
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
---
|
|
||||||
title = Hot Reload
|
|
||||||
---
|
|
||||||
# Hot Reload
|
# Hot Reload
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
---
|
|
||||||
title = HTML
|
|
||||||
---
|
|
||||||
# HTML
|
# HTML
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = HTTP
|
|
||||||
---
|
|
||||||
# HTTP
|
# HTTP
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = Ini
|
|
||||||
---
|
|
||||||
# Ini
|
# Ini
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = Json
|
|
||||||
---
|
|
||||||
# Json
|
# Json
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = Markdown
|
|
||||||
---
|
|
||||||
# Markdown
|
# Markdown
|
||||||
----------
|
----------
|
||||||
|
|
@ -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.
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = Server
|
|
||||||
---
|
|
||||||
# Server
|
# Server
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = SHA-1
|
|
||||||
---
|
|
||||||
# SHA-1
|
# SHA-1
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = Socket
|
|
||||||
---
|
|
||||||
# Socket
|
# Socket
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = Str
|
|
||||||
---
|
|
||||||
# Str
|
# Str
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = StrStream
|
|
||||||
---
|
|
||||||
# StrStream
|
# StrStream
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = Tracelog
|
|
||||||
---
|
|
||||||
# Tracelog
|
# Tracelog
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = UTF-8
|
|
||||||
---
|
|
||||||
# UTF-8
|
# UTF-8
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = Vec
|
|
||||||
---
|
|
||||||
# Vec
|
# Vec
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = VMem
|
|
||||||
---
|
|
||||||
# VMem
|
# VMem
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = WebSocket
|
|
||||||
---
|
|
||||||
# WebSocket
|
# WebSocket
|
||||||
----------
|
----------
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
---
|
|
||||||
title = Xml
|
|
||||||
---
|
|
||||||
# Xml
|
# Xml
|
||||||
----------
|
----------
|
||||||
14
tools/docs.c
14
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 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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue