From e6df71595550e4583f9edd2e4b8a9f70df945c55 Mon Sep 17 00:00:00 2001 From: Araozu Date: Sat, 28 Sep 2024 07:21:56 -0500 Subject: [PATCH] feat: Add docs --- src/components/Code.astro | 3 +- src/components/Navbar.astro | 18 ++- src/components/TwoColumn.astro | 7 +- src/layouts/DocsLayout.astro | 1 + src/layouts/PagesLayout.astro | 5 +- src/lexer/highlighter.ts | 19 ++- src/lexer/types.ts | 35 ++--- src/pages/learn/cheatsheet.md | 62 --------- src/pages/learn/cheatsheet.mdx | 230 +++++++++++++++++++++++++++++++++ src/pages/learn/index.mdx | 2 +- src/pages/learn/install.md | 10 +- 11 files changed, 282 insertions(+), 110 deletions(-) delete mode 100644 src/pages/learn/cheatsheet.md create mode 100644 src/pages/learn/cheatsheet.mdx diff --git a/src/components/Code.astro b/src/components/Code.astro index 709f5e9..fa58787 100644 --- a/src/components/Code.astro +++ b/src/components/Code.astro @@ -9,8 +9,7 @@ const [native_html, error_type, error_message] = await native_highlighter(thpcod ---
thp
-    
+ class="language-thp">thp { no_warnings !== true && error_message !== null && ( diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index dda8e7b..53cc323 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -30,18 +30,24 @@ const { showSidebarButton = true } = Astro.props; > Learn + + - diff --git a/src/components/TwoColumn.astro b/src/components/TwoColumn.astro index 7d9dfb4..f224d19 100644 --- a/src/components/TwoColumn.astro +++ b/src/components/TwoColumn.astro @@ -1,3 +1,8 @@ -
+--- +const {cols} = Astro.props; +const grid_cols = cols ?? "grid-cols-[10rem_auto]"; +--- + +
diff --git a/src/layouts/DocsLayout.astro b/src/layouts/DocsLayout.astro index 1de543e..2d6102f 100644 --- a/src/layouts/DocsLayout.astro +++ b/src/layouts/DocsLayout.astro @@ -13,6 +13,7 @@ const indexSubpath = `/learn/index.mdx`; posts={posts} indexSubpath={indexSubpath} basePath="/learn/" + disable_container={!!frontmatter.disable_container} > diff --git a/src/layouts/PagesLayout.astro b/src/layouts/PagesLayout.astro index c7cc238..8768ffc 100644 --- a/src/layouts/PagesLayout.astro +++ b/src/layouts/PagesLayout.astro @@ -10,6 +10,7 @@ const { posts: _posts, indexSubpath, basePath, + disable_container, } = Astro.props; const posts: Record[] = _posts; @@ -78,7 +79,7 @@ for (const entry of pagesIndex) {