Skip to content

Commit 8c805a8

Browse files
madster456N2D4
andauthored
[Docs][Util][Content] - refactor docs to single source (#919)
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> Removes Platform selection, moves docs to single /content folder and no longer gens docs. Only API docs are generated here. <!-- RECURSEML_SUMMARY:START --> ## High-level PR Summary This PR makes significant changes to the documentation structure by removing platform-specific content organization and consolidating docs into a single `/content` folder. The primary goal is to simplify the documentation architecture by eliminating the platform-specific routing (Next.js, React, JavaScript, Python) and instead organizing content by topic (guides, SDK, components) regardless of platform. The PR removes platform selection functionality, platform-specific navigation, and the automatic generation of platform-specific documentation pages. It introduces a new docs tree filtering system that organizes content by section rather than by platform. These changes should make the documentation more maintainable and easier to navigate while focusing on the content itself rather than platform-specific variations. ⏱️ Estimated Review Time: 30-90 minutes <details> <summary>💡 Review Order Suggestion</summary> | Order | File Path | |-------|-----------| | 1 | `docs/package.json` | | 2 | `docs/src/lib/docs-tree.ts` | | 3 | `docs/src/lib/navigation-utils.ts` | | 4 | `docs/src/components/homepage/iconHover.tsx` | | 5 | `docs/src/components/sdk/overview.tsx` | | 6 | `docs/src/components/layouts/shared/section-utils.ts` | | 7 | `docs/src/components/layout/custom-search-dialog.tsx` | | 8 | `docs/src/app/api/search/route.ts` | | 9 | `docs/src/app/docs/[[...slug]]/page.tsx` | | 10 | `docs/src/components/layouts/docs-header-wrapper.tsx` | | 11 | `docs/src/components/layouts/docs-layout-router.tsx` | | 12 | `docs/src/components/layouts/docs.tsx` | | 13 | `package.json` | </details> [![Need help? Join our Discord](https://img.shields.io/badge/Need%20help%3F%20Join%20our%20Discord-5865F2?style=plastic&logo=discord&logoColor=white)](https://discord.gg/n3SsVDAW6U) <!-- RECURSEML_SUMMARY:END --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added many new guides (auth providers, OAuth, JWT, API keys, emails, webhooks, orgs/teams, permissions, onboarding, customization), expanded SDK & component reference pages, examples, and navigation metadata. * Switched docs to a simpler section-based, platform-agnostic structure and improved getting-started and production checklists. * **Developer Experience** * Enhanced docs UX: improved code-example UI with platform/framework selectors, theme-aware highlighted code blocks, image zoom, and a centralized code-sample registry. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
1 parent 616c281 commit 8c805a8

File tree

146 files changed

+14295
-3291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+14295
-3291
lines changed

docs/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ yarn-error.log*
2727
.vercel
2828
next-env.d.ts
2929

30-
# ignore all generated docs content
31-
/content/docs/
30+
# ignore generated API content
3231
/content/api/
3332
/public/openapi/
3433
/openapi/

docs/code-examples/index.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { CodeExample } from '../lib/code-examples';
2+
import { setupExamples } from './setup';
3+
4+
const allExamples: Record<string, Record<string, Record<string, CodeExample[]>>> = {
5+
'setup': setupExamples,
6+
// Add more sections here as needed:
7+
// 'auth': authExamples,
8+
// 'customization': customizationExamples,
9+
};
10+
11+
export function getExample(documentPath: string, exampleName: string): CodeExample[] | undefined {
12+
const [section, ...rest] = documentPath.split('/');
13+
const subsection = rest.join('/');
14+
return allExamples[section]?.[subsection]?.[exampleName];
15+
}
16+
17+
export function getDocumentExamples(documentPath: string): Record<string, CodeExample[]> | undefined {
18+
const [section, ...rest] = documentPath.split('/');
19+
const subsection = rest.join('/');
20+
return allExamples[section]?.[subsection];
21+
}
22+

0 commit comments

Comments
 (0)