stack/docs
Madison f3d0a68720
[Docs][Content] - Updates Example Pages -> Vite Vanilla JS examples (#1050)
<!--
Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md
-->

feat(docs): centralize code examples with dynamic variant tabs

This PR introduces a system for managing code examples centrally while
supporting file-based variant tabs (like html/script) within a single
code block.

## Changes

- **Extended variant system**: `PlatformCodeblock` now supports custom
variant names beyond just 'server'/'client', enabling tabs for any file
grouping (e.g., html/script pairs)
- **Vite example migration**: Moved vite-example.mdx code to
`code-examples/vite-example.ts` with html/script variants
- **LLM copy support**: The "Copy Markdown" button now expands
`PlatformCodeblock` components to inline the actual code, so LLMs
receive the full code examples instead of component references

## How it works

Code examples with variants are now displayed with filename-based tabs:
- Define examples with `variant: 'html'` and `variant: 'script'` in
`code-examples/`
- The tab labels automatically use the `filename` property
- When copying markdown for LLMs, all variants are included with their
filenames


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **Documentation**
* Added a Vite JavaScript example guide with grouped auth examples
(init, index, password, OTP, OAuth) and wired examples into the
getting-started navigation.
* Removed the previous multi-page example guide and replaced it with the
new Vite-focused page.
* Documentation generation now expands platform code blocks to inline
concrete examples for clearer rendered docs.

* **Refactor**
* Improved code-example variant handling to support flexible variant
names for better tabbed/code-sample organization.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-12-22 08:53:51 -06:00
..
code-examples [Docs][Content] - Updates Example Pages -> Vite Vanilla JS examples (#1050) 2025-12-22 08:53:51 -06:00
content [Docs][Content] - Updates Example Pages -> Vite Vanilla JS examples (#1050) 2025-12-22 08:53:51 -06:00
lib [Docs][Content] - Updates Example Pages -> Vite Vanilla JS examples (#1050) 2025-12-22 08:53:51 -06:00
public [Docs][Content] - MCP installation instructions (#915) 2025-10-10 13:31:48 -05:00
scripts [Docs][Util][Content] - refactor docs to single source (#919) 2025-10-20 12:42:46 -05:00
src [Docs][Content] - Updates Example Pages -> Vite Vanilla JS examples (#1050) 2025-12-22 08:53:51 -06:00
templates [Docs][Content] - Fix CLI template filename in documentation (#1053) 2025-12-18 15:18:09 -06:00
templates-api Rename offer to product, offer group to product catalog (#914) 2025-10-04 02:28:28 -07:00
templates-python [Docs][Content][UI] - JWT docs and JWT component (#905) 2025-09-29 13:05:33 -05:00
.env.development Customizable ports (#962) 2025-10-20 15:24:47 -07:00
.eslintrc.json New docs (#698) 2025-06-20 13:30:01 -07:00
.gitignore [Docs][Site] + [Dashboard][UI] - Adds docs to Stack Companion (#869) 2025-10-30 20:01:30 -05:00
CHANGELOG.md chore: update package versions 2025-12-11 14:35:13 -08:00
cli.json New docs (#698) 2025-06-20 13:30:01 -07:00
next.config.mjs [Docs][Site] + [Dashboard][UI] - Adds docs to Stack Companion (#869) 2025-10-30 20:01:30 -05:00
package.json chore: update package versions 2025-12-11 14:35:13 -08:00
postcss.config.mjs New docs (#698) 2025-06-20 13:30:01 -07:00
README.md New docs (#698) 2025-06-20 13:30:01 -07:00
source.config.ts [Docs][Content] - Rework overview page and slight updates to codeblocks (#1056) 2025-12-17 15:39:35 -06:00
tsconfig.json New docs (#698) 2025-06-20 13:30:01 -07:00

stack-docs

This is a Next.js application generated with Create Fumadocs.

Run development server:

npm run dev
# or
pnpm dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

Explore

In the project, you can see:

  • lib/source.ts: Code for content source adapter, loader() provides the interface to access your content.
  • app/layout.config.tsx: Shared options for layouts, optional but preferred to keep.
Route Description
app/(home) The route group for your landing page and other pages.
app/docs The documentation layout and pages.
app/api The documentation for API pages.
app/api/search/route.ts The Route Handler for search.

Fumadocs MDX

A source.config.ts config file has been included, you can customise different options like frontmatter schema.

Read the Introduction for further details.

Learn More

To learn more about Next.js and Fumadocs, take a look at the following resources: