diff --git a/apps/docs/content/docs/guides.mdx b/apps/docs/content/docs/guides.mdx deleted file mode 100644 index 5ea0894f9c8..00000000000 --- a/apps/docs/content/docs/guides.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Guides -description: In-depth guides for using Superset ---- - -## Guides - -This section contains detailed guides for using Superset effectively. - -More guides coming soon! diff --git a/apps/docs/content/docs/meta.json b/apps/docs/content/docs/meta.json index 089e504d7e3..9873447de40 100644 --- a/apps/docs/content/docs/meta.json +++ b/apps/docs/content/docs/meta.json @@ -1,14 +1,13 @@ { "title": "Documentation", "pages": [ - "---Get Started---", + "---Rocket Get Started---", "quick-start", "overview", "installation", - "---Core Features---", + "---Gauge Core Features---", "core-features", - "---How to Guides---", - "guides", + "---BookOpen How to Guides---", "setup-teardown-scripts" ] } diff --git a/apps/docs/content/docs/quick-start.mdx b/apps/docs/content/docs/quick-start.mdx index da6b9b577b0..506bc7a98f7 100644 --- a/apps/docs/content/docs/quick-start.mdx +++ b/apps/docs/content/docs/quick-start.mdx @@ -13,10 +13,3 @@ Get started with Superset in just a few steps: 4. **Start working** - You're ready to go! - -## Next Steps - - - - - diff --git a/apps/docs/package.json b/apps/docs/package.json index 1765e22b426..41f1a4fe9ce 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -11,9 +11,13 @@ "postinstall": "fumadocs-mdx" }, "dependencies": { + "@radix-ui/react-collapsible": "^1.1.12", + "@radix-ui/react-scroll-area": "^1.2.10", "@sentry/nextjs": "^10.32.1", "@superset/shared": "workspace:*", "@t3-oss/env-nextjs": "^0.13.8", + "class-variance-authority": "^0.7.1", + "framer-motion": "^12.23.26", "fumadocs-core": "16.4.7", "fumadocs-mdx": "14.2.5", "fumadocs-ui": "16.4.7", @@ -34,6 +38,7 @@ "@types/react-dom": "^19.2.3", "postcss": "^8.5.6", "tailwindcss": "^4.0.9", + "tailwindcss-animate": "^1.0.7", "typescript": "^5.9.3" } } diff --git a/apps/docs/src/app/(docs)/[[...slug]]/components/DocsPageLayout/DocsPageLayout.tsx b/apps/docs/src/app/(docs)/[[...slug]]/components/DocsPageLayout/DocsPageLayout.tsx new file mode 100644 index 00000000000..b91718054ae --- /dev/null +++ b/apps/docs/src/app/(docs)/[[...slug]]/components/DocsPageLayout/DocsPageLayout.tsx @@ -0,0 +1,246 @@ +import type { TableOfContents } from "fumadocs-core/toc"; +import { AnchorProvider } from "fumadocs-core/toc"; +import { I18nLabel } from "fumadocs-ui/contexts/i18n"; +import { Edit, Text } from "lucide-react"; +import type { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from "react"; +import { forwardRef } from "react"; +import { buttonVariants } from "@/components/Button"; +import { cn } from "@/lib/cn"; +import type { TOCProps } from "./components/PageClient/components/TableOfContents/TableOfContents"; +import { + TOCItems, + TOCScrollArea, + Toc, + TocPopoverContent, + TocPopoverTrigger, +} from "./components/PageClient/components/TableOfContents/TableOfContents"; +import type { FooterProps } from "./components/PageClient/PageClient"; +import { + Footer, + LastUpdate, + PageArticle, + PageBody, + TocPopoverHeader, +} from "./components/PageClient/PageClient"; + +type TableOfContentOptions = Omit & { + enabled: boolean; + component: ReactNode; + header?: ReactNode; + footer?: ReactNode; +}; + +type TableOfContentPopoverOptions = Omit; + +interface EditOnGitHubOptions + extends Omit, "href" | "children"> { + owner: string; + repo: string; + branch?: string; + path: string; +} + +interface FooterOptions extends FooterProps { + enabled: boolean; + component: ReactNode; +} + +export interface DocsPageProps { + toc?: TableOfContents; + full?: boolean; + tableOfContent?: Partial; + tableOfContentPopover?: Partial; + footer?: Partial; + editOnGithub?: EditOnGitHubOptions; + lastUpdate?: Date | string | number; + children: ReactNode; + container?: HTMLAttributes; + article?: HTMLAttributes; +} + +export function DocsPage({ + toc = [], + full = false, + tableOfContentPopover: { + enabled: tocPopoverEnabled, + component: tocPopoverReplace, + ...tocPopoverOptions + } = {}, + tableOfContent: { + enabled: tocEnabled, + component: tocReplace, + ...tocOptions + } = {}, + footer: { + enabled: footerEnabled, + component: footerReplace, + ...footerOptions + } = {}, + editOnGithub, + lastUpdate, + children, + container, + article, +}: DocsPageProps) { + const isTocRequired = + toc.length > 0 || + tocOptions.footer !== undefined || + tocOptions.header !== undefined; + + // disable TOC on full mode, you can still enable it with `enabled` option. + tocEnabled ??= !full && isTocRequired; + + tocPopoverEnabled ??= + toc.length > 0 || + tocPopoverOptions.header !== undefined || + tocPopoverOptions.footer !== undefined; + + // enable footer by default + footerEnabled ??= true; + + return ( + + + {tocPopoverEnabled && !tocPopoverReplace ? ( + + + + {tocPopoverOptions.header} + + + + {tocPopoverOptions.footer} + + + ) : ( + tocPopoverReplace + )} + + {children} +
+
+ {editOnGithub ? : null} + {lastUpdate ? : null} +
+ {footerEnabled && !footerReplace ? ( +