Start working on docs pages.

This commit is contained in:
Joshua Bemenderfer 2023-02-14 16:59:31 -05:00
parent 3b464c523e
commit 7dd718691b
4 changed files with 56 additions and 2 deletions

View File

@ -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) }}

View File

@ -9,7 +9,6 @@ Section dark
Block
class w-full lg:w-1/3
TableOfContents
Block

54
docs/src/docs/c/index.tce Normal file
View File

@ -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.<br/>
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

View File

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