Contributing to Documentation
This guide explains how the documentation is structured and how to contribute updates.
Technology Stack
The documentation is built with:
- Nextra 4 - Documentation framework built on Next.js
- MDX - Markdown with JSX support
- Next.js 15 - React framework
Project Structure
docs-nextra/
├── app/ # Next.js app directory
│ ├── docs/ # Docs route configuration
│ ├── globals.css # Global styles
│ ├── layout.jsx # Root layout
│ └── page.jsx # Landing page
├── content/ # Documentation content (MDX files)
│ ├── _meta.js # Root navigation config
│ ├── index.mdx # Introduction page
│ ├── gettingstarted/ # Getting Started section
│ ├── apis/ # APIs section
│ ├── annotations/ # Annotations section
│ ├── integrations/ # Integrations section
│ └── tutorials/ # Tutorials section
├── package.json
└── next.config.mjsRunning Locally
Install Dependencies
cd docs-nextra
npm installStart Development Server
npm run devThe documentation will be available at http://localhost:3000.
Build for Production
npm run buildAdding and Editing Pages
Creating a New Page
- Create a new
.mdxfile in the appropriate folder undercontent/ - Add frontmatter at the top of the file:
---
title: Page Title
description: Brief description for SEO
---
# Page Title
Your content here...- Update the
_meta.jsfile in the same folder to include your page in the navigation
Editing Existing Pages
Simply edit the .mdx file directly. Changes will be reflected immediately in development mode.
Navigation Configuration
Navigation is controlled by _meta.js files in each folder.
Root Navigation (content/_meta.js)
export default {
index: {
title: 'Introduction'
},
gettingstarted: {
title: 'Getting Started'
},
apis: {
title: 'APIs'
},
'---': {
type: 'separator'
},
'support-this-project': {
title: 'Support This Project'
}
}Section Navigation
Each subfolder can have its own _meta.js to control page order:
// content/tutorials/_meta.js
export default {
'smart-contract-calls': 'Smart Contract Calls',
'nft-minting': 'NFT Minting',
'legacy-tutorials': 'Legacy Tutorials'
}MDX Features
Code Blocks
Use triple backticks with language specification:
```java
public class Example {
public static void main(String[] args) {
System.out.println("Hello, Cardano!");
}
}
```Info Callouts
Use blockquotes for info boxes:
> **Important Note**
>
> This will render as a styled info box with an icon.Links
[External Link](https://example.com)
[Internal Link](/docs/gettingstarted/dependencies)Collapsible Sections
<details>
<summary>Click to expand</summary>
Hidden content goes here...
</details>Styled Cards
<div style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
gap: '1rem'
}}>
<a href="https://example.com" style={{
display: 'block',
padding: '1.25rem',
background: 'linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%)',
border: '1px solid rgba(59, 130, 246, 0.2)',
borderRadius: '12px',
textDecoration: 'none',
color: 'inherit'
}}>
<div style={{ fontWeight: '600' }}>Card Title</div>
<div style={{ fontSize: '0.85rem', opacity: '0.8' }}>Card description</div>
</a>
</div>Best Practices
- Keep pages focused - Each page should cover a single topic
- Use descriptive titles - Titles should clearly indicate the content
- Include code examples - Practical examples help users understand concepts
- Link related pages - Help users discover related content
- Update navigation - Always update
_meta.jswhen adding new pages - Test locally - Preview changes before submitting a PR
Submitting Changes
- Fork the repository
- Create a feature branch
- Make your changes
- Test locally with
npm run dev - Submit a pull request to the main repository
For questions or suggestions, please open an issue .
Last updated on