From a768e436edac8210f4f7c7ccbfcfa5f5f9bf6d51 Mon Sep 17 00:00:00 2001 From: Alex Stephen <1325798+rambleraptor@users.noreply.github.com> Date: Tue, 24 Sep 2024 23:19:42 -0400 Subject: [PATCH] add website readme (#22) --- .github/workflows/build.yaml | 2 ++ .github/workflows/publish.yaml | 2 ++ README.md | 35 +++++++++++++++++++--------------- scripts/generate.ts | 3 +++ 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bff8ebe..71d9d9c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,6 +28,8 @@ jobs: path: './api-linter' - name: Create rules folder run: mkdir -p src/content/docs/tooling/linter/rules + - name: Create website folder + run: mkdir -p src/content/docs/tooling/website - name: Install all dependencies. run: npm install - name: Generate all static pages. diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 5a8366b..9f5f9e2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -30,6 +30,8 @@ jobs: path: './api-linter' - name: Create rules folder run: mkdir -p src/content/docs/tooling/linter/rules + - name: Create website folder + run: mkdir -p src/content/docs/tooling/website - name: Install all dependencies. run: npm install - name: Generate all static pages. diff --git a/README.md b/README.md index e09bf55..af8c595 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,33 @@ -# Starlight Starter Kit: Basics +# AEP Site Generator -[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build) +## Overview -``` -npm create astro@latest -- --template starlight -``` +The AEP Site Generator takes in all of our documentation from multiple +repositories and generates the AEP website. + +The site generator is made of multiple parts: -[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics) -[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics) -[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics) -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs) +* A CI workflow +* A generator script that reads the various repos + converts their + documentation to formats supported by Starlight +* A (very standard) [Starlight](https://starlight.astro.build) website. -> πŸ§‘β€πŸš€ **Seasoned astronaut?** Delete this file. Have fun! +## Generator -## πŸš€ Project Structure +The generator script reads documentation from all of the repos and writes files +for Starlight to read. -Inside of your Astro + Starlight project, you'll see the following folders and files: +At a high level, the generator script writes out Markdown / MDX (Markdown with +React added) files to src/content/docs for Starlight to read. It also generates +various JSON files in generated/ to build the sidebar and other config. + +## πŸš€ Starlight Project Structure ``` . β”œβ”€β”€ public/ +β”œβ”€β”€ scripts/ +β”‚ β”œβ”€β”€ generate.ts β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ assets/ β”‚ β”œβ”€β”€ content/ @@ -50,6 +58,3 @@ All commands are run from the root of the project, from a terminal: | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro -- --help` | Get help using the Astro CLI | -## πŸ‘€ Want to learn more? - -Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat). diff --git a/scripts/generate.ts b/scripts/generate.ts index ce743a1..de7e823 100644 --- a/scripts/generate.ts +++ b/scripts/generate.ts @@ -297,6 +297,8 @@ sidebar = await writePages(AEP_LOC, sidebar); // Write linter pages. await writePage(AEP_LINTER_LOC, "README.md", "src/content/docs/tooling/linter/index.md", "Protobuf Linter") +// Write site generator. +await writePage(".", "README.md", "src/content/docs/tooling/website/index.md", "") writeSidebar(sidebar, "sidebar.json"); // Write out linter rules. @@ -307,6 +309,7 @@ for (var rule of consolidated_rules) { } var linter_sidebar = buildLinterSidebar(consolidated_rules); +addToSidebar(linter_sidebar, "Tooling", [{label: "Website", link: "tooling/website"}]); writeSidebar(linter_sidebar, "linter_sidebar.json"); buildIndexPage(aeps);