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
|
||||
-----------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
---
|
||||
title = Base 64
|
||||
---
|
||||
# Base 64
|
||||
----------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
---
|
||||
title = Threads
|
||||
---
|
||||
# Threads
|
||||
----------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
---
|
||||
title = Dir
|
||||
---
|
||||
# Dir
|
||||
----------
|
||||
|
||||
|
|
|
|||
BIN
docs/docs.com
BIN
docs/docs.com
Binary file not shown.
|
|
@ -1,6 +1,3 @@
|
|||
---
|
||||
title = File
|
||||
---
|
||||
# File
|
||||
----------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
---
|
||||
title = Format
|
||||
---
|
||||
# Format
|
||||
----------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
---
|
||||
title = Highlight
|
||||
---
|
||||
# Highlight
|
||||
----------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
---
|
||||
title = Hot Reload
|
||||
---
|
||||
# Hot Reload
|
||||
----------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
---
|
||||
title = HTML
|
||||
---
|
||||
# HTML
|
||||
----------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = HTTP
|
||||
---
|
||||
# HTTP
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = Ini
|
||||
---
|
||||
# Ini
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = Json
|
||||
---
|
||||
# Json
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = Markdown
|
||||
---
|
||||
# Markdown
|
||||
----------
|
||||
|
|
@ -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.
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = Server
|
||||
---
|
||||
# Server
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = SHA-1
|
||||
---
|
||||
# SHA-1
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = Socket
|
||||
---
|
||||
# Socket
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = Str
|
||||
---
|
||||
# Str
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = StrStream
|
||||
---
|
||||
# StrStream
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = Tracelog
|
||||
---
|
||||
# Tracelog
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = UTF-8
|
||||
---
|
||||
# UTF-8
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = Vec
|
||||
---
|
||||
# Vec
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = VMem
|
||||
---
|
||||
# VMem
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = WebSocket
|
||||
---
|
||||
# WebSocket
|
||||
----------
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
---
|
||||
title = 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 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue