Get Started
Our documentation uses Starlight with Astro and MDX pages. This guide will help you get started with contributing to the documentation.
Initial Setup
Section titled “Initial Setup”- Fork our repository on GitHub. (You can click the edit button on the bottom left of this page to do this.)
- Clone your fork to your local machine.
cdinto thedocsdirectory and runpnpm install.- Run
pnpm run devto start the development server.
Development Server
Section titled “Development Server”Once you’ve installed dependencies, you can start the development server:
pnpm run devThe documentation site will be available at http://localhost:3000. The development server automatically reloads when you make changes to files.
Project Structure
Section titled “Project Structure”The documentation follows a standard Astro/Starlight structure:
src/- Source files for the documentationcontent/docs/- Documentation pages organized by language (e.g.,en/,es/)components/- Reusable Astro components and custom theme overridesassets/- Images, SVGs, and other static assetscontent.config.ts- Content collections configuration
public/- Static files served as-isastro.config.mjs- Astro configuration with Starlight and plugin settings
Writing Documentation
Section titled “Writing Documentation”File Format
Section titled “File Format”Documentation pages are written in MDX (Markdown with JSX support). Create new files in the appropriate directory under src/content/docs/en/ (or other language codes).
Frontmatter
Section titled “Frontmatter”Every documentation page must start with frontmatter that defines metadata:
---title: Page Titledescription: A brief description of the pagesidebar: order: 1---Common frontmatter options:
title- Page title (required)description- Meta description for SEOsidebar- Sidebar configuration (order, label, etc.)draft- Set totrueto hide the page from navigation
Using Starlight Components
Section titled “Using Starlight Components”Starlight provides several built-in components you can use in your MDX:
Use the <Steps> component for numbered instructions:
import { Steps } from '@astrojs/starlight/components'
<Steps> 1. First step here 2. Second step here 3. Third step here</Steps>Output
Section titled “Output”- First step here
- Second step here
- Third step here
Use the <Tabs> component to show content in tabs:
import { Tabs, TabItem } from '@astrojs/starlight/components'
<Tabs> <TabItem label="Option A"> Content for Option A </TabItem> <TabItem label="Option B"> Content for Option B </TabItem></Tabs>Output
Section titled “Output”Content for Option A
Content for Option B
Aside (Notes, Tips, Warnings)
Section titled “Aside (Notes, Tips, Warnings)”Use the <Aside> component for callout boxes:
import { Aside } from '@astrojs/starlight/components'
<Aside type="note"> This is a note with additional information.</Aside>
<Aside type="tip"> This is a helpful tip.</Aside>
<Aside type="caution"> This is a caution or warning.</Aside>
<Aside type="danger"> This is critical information.</Aside>Output
Section titled “Output”You can also use the Github-style alert syntax:
> [!Note]> This is a note with additional information.
> [!Tip]> This is a helpful tip.
> [!Important]> This is a caution or warning.
> [!Caution]> This is critical information.Output
Section titled “Output”Code Blocks
Section titled “Code Blocks”Use standard Markdown code blocks with syntax highlighting:
```bashpnpm run dev```
```javascriptconst greeting = "Hello, World!";console.log(greeting);```Output
Section titled “Output”pnpm run devconst greeting = "Hello, World!";console.log(greeting);You can add a filename and highlight specific lines:
```javascript title="src/components/MyComponent.astro" {2,4}const greeting = "Hello";const name = "World";console.log(greeting, name);```Output
Section titled “Output”const greeting = "Hello";const name = "World";console.log(greeting, name);Use the <Icon /> component from astro-icon to add icons:
import { Icon } from 'astro-icon/components'
<Icon name="simple-icons:github" />Output
Section titled “Output”Images and Assets
Section titled “Images and Assets”Store images in src/assets/ and reference them in your MDX:
import { Image } from 'astro:assets'import myImage from '../../../assets/my-image.png'
<Image src={myImage} alt="Description of the image" />Or use relative image paths:
Navigation and Sidebar
Section titled “Navigation and Sidebar”The sidebar is automatically generated based on the file structure and frontmatter. To customize the sidebar order, use the sidebar.order property in frontmatter:
---title: My Pagesidebar: order: 1---For grouping pages into sections, organize them in subdirectories. The sidebar will automatically group files by directory.
Localization
Section titled “Localization”Our documentation supports multiple languages. Each language has its own directory under src/content/docs/:
en/- Englishes/- Spanishfr/- French- And many others…
To add documentation in another language, create a new language directory and follow the same structure as the English documentation. Use the language code (e.g., de for German) as the directory name.
You can read more about localizing the documentation in our documentation translation guide.
Plugins and Extensions
Section titled “Plugins and Extensions”Our Starlight setup includes several plugins:
- starlight-theme-nova - Custom theme styling
- starlight-github-alerts - GitHub-style alerts support
- starlight-changelogs - Changelog management
- starlight-openapi - OpenAPI documentation integration
- starlight-sidebar-topics - Sidebar organization
These plugins provide additional features and customization options.
Building and Deployment
Section titled “Building and Deployment”To build the documentation for production:
pnpm run buildTo preview the production build locally:
pnpm run previewThe built site will be in the dist/ directory.
Best Practices
Section titled “Best Practices”- Keep it clear and concise – Use short sentences and clear language
- Use examples – Provide code examples and real-world use cases
- Add metadata – Always include proper frontmatter with descriptions
- Check links - Ensure all internal and external links are valid
- Use appropriate components – Leverage Starlight components for better readability
- Consistent formatting – Follow the existing documentation style
- Mobile-friendly - Starlight is responsive by default, but test on mobile
- Preview changes – Use the dev server to preview your changes before committing
Styling with Tailwind CSS
Section titled “Styling with Tailwind CSS”The documentation uses Tailwind CSS through @astrojs/starlight-tailwind. Custom CSS can be added in src/styles/ and imported in your MDX files or Astro components.
Troubleshooting
Section titled “Troubleshooting”Dev server not starting
Section titled “Dev server not starting”- Make sure you’ve run
pnpm installin thedocsdirectory - Check that port 3000 is not in use
- Try deleting
node_modules/and.astro/and reinstalling
Changes not reflecting
Section titled “Changes not reflecting”- The dev server should auto-reload, but try stopping and restarting it
- Clear your browser cache if styles aren’t updating
Build errors
Section titled “Build errors”- Check for syntax errors in MDX files
- Ensure all imports are correct
- Run
pnpm run buildto see full error messages