This guide helps LLMs work with the Apache Superset documentation site built with Docusaurus 3.
You are currently in the /docs subdirectory of the Apache Superset repository. When referencing files from the main codebase, use ../ to access the parent directory.
/Users/evan_1/GitHub/superset/ # Main repository root
├── superset/ # Python backend code
├── superset-frontend/ # React/TypeScript frontend
└── docs/ # Documentation site (YOU ARE HERE)
├── docs/ # Main documentation content
├── developer_portal/ # Developer guides (currently disabled)
├── components/ # Component playground (currently disabled)
└── docusaurus.config.ts # Site configuration
# Development yarn start # Start dev server on http://localhost:3000 yarn stop # Stop running dev server yarn build # Build production site yarn serve # Serve built site locally # Version Management (USE THESE, NOT docusaurus commands) yarn version:add:docs <version> # Add new docs version yarn version:add:developer_portal <version> # Add developer portal version yarn version:add:components <version> # Add components version yarn version:remove:docs <version> # Remove docs version yarn version:remove:developer_portal <version> # Remove developer portal version yarn version:remove:components <version> # Remove components version # Quality Checks yarn typecheck # TypeScript validation yarn eslint # Lint TypeScript/JavaScript files
/docs)The primary documentation lives in /docs with this structure:
docs/
├── intro.md # Auto-generated from ../README.md
├── quickstart.mdx # Getting started guide
├── api.mdx # API reference with Swagger UI
├── faq.mdx # Frequently asked questions
├── installation/ # Installation guides
│ ├── installation-methods.mdx
│ ├── docker-compose.mdx
│ ├── docker-builds.mdx
│ ├── kubernetes.mdx
│ ├── pypi.mdx
│ └── architecture.mdx
├── configuration/ # Configuration guides
│ ├── configuring-superset.mdx
│ ├── alerts-reports.mdx
│ ├── caching.mdx
│ ├── databases.mdx
│ └── [more config docs]
├── using-superset/ # User guides
│ ├── creating-your-first-dashboard.md
│ ├── exploring-data.mdx
│ └── [more user docs]
├── contributing/ # Contributor guides
│ ├── development.mdx
│ ├── testing-locally.mdx
│ └── [more contributor docs]
└── security/ # Security documentation
├── security.mdx
└── [security guides]
/developer_portal) - Currently DisabledWhen enabled, contains developer-focused content:
/components) - Currently DisabledWhen enabled, provides interactive component examples for UI development.
.md files: Basic Markdown documents.mdx files: Markdown with JSX - can include React components.tsx files in /src: Custom React components and pagesEvery documentation page should have frontmatter:
--- title: Page Title description: Brief description for SEO sidebar_position: 1 # Optional: controls order in sidebar ---
MDX files can import and use React components:
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; <Tabs> <TabItem value="npm" label="npm" default> ```bash npm install superset ``` </TabItem> <TabItem value="yarn" label="yarn"> ```bash yarn add superset ``` </TabItem> </Tabs>
Use triple backticks with language identifiers:
```python def hello_world(): print("Hello, Superset!") ``` ```sql title="Example Query" SELECT * FROM users WHERE active = true; ``` ```bash # Installation command pip install apache-superset ```
Docusaurus supports various admonition types:
:::note This is a note ::: :::tip This is a tip ::: :::warning This is a warning ::: :::danger This is a danger warning ::: :::info This is an info box :::
Versions are managed through versions-config.json:
{ "docs": { "disabled": false, "lastVersion": "6.0.0", // Default version shown "includeCurrentVersion": true, // Show "Next" version "onlyIncludeVersions": ["current", "6.0.0"], "versions": { "current": { "label": "Next", "path": "", "banner": "unreleased" // Shows warning banner }, "6.0.0": { "label": "6.0.0", "path": "6.0.0", "banner": "none" } } } }
IMPORTANT: Always use the custom scripts, NOT native Docusaurus commands:
# ✅ CORRECT - Updates both Docusaurus and versions-config.json yarn version:add:docs 6.1.0 # ❌ WRONG - Only updates Docusaurus, breaks version dropdown yarn docusaurus docs:version 6.1.0
When versioning, these files are created:
versioned_docs/version-X.X.X/ - Snapshot of current docsversioned_sidebars/version-X.X.X-sidebars.json - Sidebar configversions.json - List of all versionsAdd custom styles in /src/css/custom.css:
:root { --ifm-color-primary: #20a7c9; --ifm-code-font-size: 95%; }
Create React components in /src/components/:
// src/components/FeatureCard.tsx import React from 'react'; export default function FeatureCard({title, description}) { return ( <div className="card"> <h3>{title}</h3> <p>{description}</p> </div> ); }
Use in MDX:
import FeatureCard from '@site/src/components/FeatureCard'; <FeatureCard title="Fast" description="Lightning fast queries" />
Use relative paths for internal documentation:
[Installation Guide](./installation/docker-compose) [Configuration](../configuration/configuring-superset)
Always use full URLs:
[Apache Superset GitHub](https://github.com/apache/superset)
Reference code in the main repository:
See the [main configuration file](https://github.com/apache/superset/blob/master/superset/config.py)
.mdx file in the appropriate directoryThe API docs use Swagger UI embedded in /docs/api.mdx:
import SwaggerUI from "swagger-ui-react"; import "swagger-ui-react/swagger-ui.css"; <SwaggerUI url="/api/v1/openapi.json" />
Use MDX to create interactive documentation:
import CodeBlock from '@theme/CodeBlock'; import MyComponentExample from '!!raw-loader!../examples/MyComponent.tsx'; <CodeBlock language="tsx">{MyComponentExample}</CodeBlock>
When creating or updating documentation:
yarn startyarn build)Sidebars are configured in /sidebars.js:
module.exports = { CustomSidebar: [ { type: 'doc', label: 'Introduction', id: 'intro', }, { type: 'category', label: 'Installation', items: [ { type: 'autogenerated', dirName: 'installation', }, ], }, ], };
Docusaurus includes Algolia DocSearch integration configured in docusaurus.config.ts.
yarn docusaurus docs:version - Use yarn version:add:docs insteadyarn build before committingyarn stop # Kill any running servers yarn clear # Clear cache yarn start # Restart
# Check for broken links yarn build # TypeScript issues yarn typecheck # Linting issues yarn eslint
If versions don't appear in dropdown:
versions-config.json includes the versionversioned_docs/From docs/configuration/configuring-superset.mdx:
--- title: Configuring Superset hide_title: true sidebar_position: 1 version: 1 --- # Configuring Superset ## superset_config.py Superset exposes hundreds of configurable parameters through its [config.py module](https://github.com/apache/superset/blob/master/superset/config.py). ```bash export SUPERSET_CONFIG_PATH=/app/superset_config.py
**Key patterns:** - Links to source code for reference - Code blocks with bash/python examples - Environment variable documentation - Step-by-step configuration instructions ### Example: Tutorial Documentation Pattern From `docs/using-superset/creating-your-first-dashboard.mdx`: ```mdx import useBaseUrl from "@docusaurus/useBaseUrl"; ## Creating Your First Dashboard :::tip In addition to this site, [Preset.io](http://preset.io/) maintains an updated set of end-user documentation at [docs.preset.io](https://docs.preset.io/). ::: ### Connecting to a new database <img src={useBaseUrl("/img/tutorial/tutorial_01_add_database_connection.png")} width="600" />
Key patterns:
From docs/api.mdx:
import SwaggerUI from "swagger-ui-react"; import "swagger-ui-react/swagger-ui.css"; ## API Documentation <SwaggerUI url="/api/v1/openapi.json" />
Key patterns:
// For images in static folder import useBaseUrl from "@docusaurus/useBaseUrl"; <img src={useBaseUrl("/img/feature-screenshot.png")} width="600" /> // With caption <figure> <img src={useBaseUrl("/img/dashboard.png")} alt="Dashboard view" /> <figcaption>Superset Dashboard Interface</figcaption> </figure>
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; <Tabs defaultValue="docker" values={[ {label: 'Docker', value: 'docker'}, {label: 'Kubernetes', value: 'k8s'}, {label: 'PyPI', value: 'pypi'}, ]}> <TabItem value="docker"> ```bash docker-compose up ``` </TabItem> <TabItem value="k8s"> ```bash kubectl apply -f superset.yaml ``` </TabItem> <TabItem value="pypi"> ```bash pip install apache-superset ``` </TabItem> </Tabs>
```python title="superset_config.py"
# Database connection example
SQLALCHEMY_DATABASE_URI = 'postgresql://user:password@localhost/superset'
# Security configuration
SECRET_KEY = 'YOUR_SECRET_KEY_HERE'
WTF_CSRF_ENABLED = True
# Feature flags
FEATURE_FLAGS = {
'ENABLE_TEMPLATE_PROCESSING': True,
'DASHBOARD_NATIVE_FILTERS': True,
}
### Cross-Referencing Pattern ```mdx For detailed configuration options, see: - [Configuring Superset](./configuration/configuring-superset) - [Database Connections](./configuration/databases) - [Security Settings](./security/security) External resources: - [SQLAlchemy Documentation](https://docs.sqlalchemy.org/) - [Flask Configuration](https://flask.palletsprojects.com/config/)
## Prerequisites :::warning Ensure you have Python 3.9+ and Node.js 16+ installed before proceeding. ::: ## Installation Steps 1. **Clone the repository** ```bash git clone https://github.com/apache/superset.git cd superset
Install Python dependencies
pip install -e .
Initialize the database
superset db upgrade
superset init
:::tip Success Check Navigate to http://localhost:8088 and login with admin/admin :::
### Documenting API Endpoints ```mdx ## Chart API ### GET /api/v1/chart/ Returns a list of charts. **Parameters:** - `page` (optional): Page number - `page_size` (optional): Number of items per page **Example Request:** ```bash curl -X GET "http://localhost:8088/api/v1/chart/" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example Response:
{ "count": 42, "result": [ { "id": 1, "slice_name": "Sales Dashboard", "viz_type": "line" } ] }
--- **Note**: This documentation site serves as the primary resource for Superset users, administrators, and contributors. Always prioritize clarity, accuracy, and completeness when creating or updating documentation.