From 7dd718691b37b618c7bae5ae21c39db0b95e6f10 Mon Sep 17 00:00:00 2001 From: Joshua Bemenderfer Date: Tue, 14 Feb 2023 16:59:31 -0500 Subject: [PATCH] Start working on docs pages. --- docs/src/_includes/nodes/Navbar.njk | 2 +- docs/src/about.tce | 1 - docs/src/docs/c/index.tce | 54 +++++++++++++++++++++++++++++ docs/src/parser/page.js | 1 + 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 docs/src/docs/c/index.tce diff --git a/docs/src/_includes/nodes/Navbar.njk b/docs/src/_includes/nodes/Navbar.njk index 37da353..d8b94d2 100644 --- a/docs/src/_includes/nodes/Navbar.njk +++ b/docs/src/_includes/nodes/Navbar.njk @@ -27,7 +27,7 @@ lg:pointer-events-auto lg:relative lg:top-0 lg:px-0 lg:flex-row lg:flex-1 lg:h-20 lg:bg-neutral-800 lg:text-white "> - {{ navlink("/docs/", "Docs", ctx.url) }} + {{ navlink("/docs/c/", "Docs", ctx.url) }} {{ navlink("/examples/", "Examples", ctx.url) }} {{ navlink("/about/", "About", ctx.url) }} {{ navlink("/contribute/", "Contribute", ctx.url) }} diff --git a/docs/src/about.tce b/docs/src/about.tce index b823c14..31d2226 100644 --- a/docs/src/about.tce +++ b/docs/src/about.tce @@ -9,7 +9,6 @@ Section dark Block class w-full lg:w-1/3 - TableOfContents Block diff --git a/docs/src/docs/c/index.tce b/docs/src/docs/c/index.tce new file mode 100644 index 0000000..edef99a --- /dev/null +++ b/docs/src/docs/c/index.tce @@ -0,0 +1,54 @@ +layout layout.njk +title Documentation - Terrace +description + C language documentation for the Terrace programming language + +Section light + class flex flex-col md:flex-row gap-16 + + Block + class w-full lg:w-1/3 + TableOfContents + + Block + class max-w-prose + + Heading 1 Terrace C Documentation + class -ml-2 + + Markdown + Documentation is available for the following languages: + - [C](/docs/c/) - 1% Complete + - [JavaScript](/docs/javascript/) - 0% Complete + - [Python](/docs/python/) - 0% Complete + + Heading 2 Getting Started + class mt-12 mb-6 + + Markdown + The core terrace parser is distributed as a single-header C library.
+ To use it, download [parser.h](https://git.thederf.com/thederf/Terrace/src/branch/main/packages/c/parser.h) and include in your project tree. + + CodeBlock c + #include "parser.h" + Markdown + + + Heading 2 Recipes + class mt-12 + + Heading 2 Core API + class mt-12 + + Heading 3 Type: terrace_linedata_t + class my-6 + + Heading 3 Function: terrace_parse_line + class my-6 + + Heading 2 Contributing + class mt-12 + +Section dark + Footer + class w-full diff --git a/docs/src/parser/page.js b/docs/src/parser/page.js index 22d92e8..df0f5af 100644 --- a/docs/src/parser/page.js +++ b/docs/src/parser/page.js @@ -33,6 +33,7 @@ module.exports = async function(doc) { for (let i = index; i > 0; --i) { if (pageData.headings[i].level === heading.level - 1) { parent = pageData.headings[i] + break } }