feat: generate doc pages from markup

This commit is contained in:
Ax333l
2022-10-25 10:17:29 +02:00
parent 0503e81fb0
commit 214ce4934d
22 changed files with 911 additions and 176 deletions

View File

@@ -0,0 +1,28 @@
/// Types
export interface Document {
title: string;
// HTML
content: string;
}
export interface DocumentInfo {
title: string;
slug: string;
}
// A tree representing the `docs` folder.
export interface DocsTree {
// index.whatever
index: DocumentInfo;
// Everything except index.whatever
nodes: DocsTreeNode[];
}
export type DocsTreeNode = DocsTree | DocumentInfo;
/// Functions
export function is_tree(node: DocsTreeNode) {
return node.hasOwnProperty('nodes');
}