Documentation
Learn how to create, manage, and customize your documentation
MkSaaS includes a powerful documentation system built with Fumadocs and MDX. The documentation system supports multi-language content, custom components, and rich content formatting, making it ideal for product documentation, tutorials, and knowledge base articles.
Documentation System Structure
The documentation system is built using Fumadocs, a framework for building documentation sites, and integrates with internationalization.
Configuration
The documentation system can be configured in multiple places:
- The main layout configuration is in
src/app/[locale]/docs/layout.tsx
- The content source configuration is in
src/lib/docs/source.ts
- The i18n configuration is in
src/lib/docs/i18n.ts
Creating Documentation Content
Adding a New Documentation Page
- Create a new MDX file in the
content/docs
directory:
- The
icon
property in the frontmatter supports all Lucide icons and will be displayed next to the document title.
Organizing Documentation
Fumadocs allows you to organize your documentation using a hierarchical structure:
You can customize the sidebar order and grouping by using meta files:
Multi-language Support
MkSaaS documentation system fully supports internationalization. You can create content in multiple languages using the following file naming convention:
- Default locale (e.g., English):
filename.mdx
- Other locales (e.g., Chinese):
filename.zh.mdx
Multi-language Documentation Example
For an English documentation page:
For the same page in Chinese:
The system will automatically match the documentation with the appropriate language based on the user's locale.
Documentation Components
MkSaaS includes a variety of documentation components powered by Fumadocs:
Customizing the Documentation
Modifying the Layout
You can customize the documentation layout by editing src/app/[locale]/docs/layout.tsx
. This file controls the navigation, sidebar, and overall structure of the documentation pages.
Creating Custom Components
To create custom components for your documentation:
- Add your component to the
src/components/shared/custom-mdx-content.tsx
file - Map it to the appropriate MDX element in the components object
Example of customizing the img
tag to use a enhanced ImageZoom
component:
This customization enhances all images in your MDX content with zoom functionality, responsive sizing, and improved loading performance. You can use standard Markdown syntax in your MDX files and the custom component will automatically be applied:
Advanced Configuration
For more advanced customization of the documentation system, you can refer to the Fumadocs documentation:
Fumadocs UI
Learn about docs layout customization
Fumadocs Components
Additional components to improve your docs
Internationalization
Advanced i18n features for your documentation
Markdown
Learn about Markdown features and syntax
Best Practices
- Consistent Structure: Maintain a consistent structure across documentation pages
- Clear Headings: Use descriptive headings that follow a logical hierarchy
- Code Examples: Include practical code examples where appropriate
- Visuals: Use diagrams, screenshots, or interactive components to explain complex concepts
- Progressive Disclosure: Start with basic concepts and gradually introduce more complex topics
- Cross-Linking: Link related documentation pages to help users navigate your content
- Versioning: Consider documentation versioning for different software releases
- Accessibility: Ensure your documentation is accessible to all users
- Search Optimization: Use clear titles and descriptions to make content discoverable
Next Steps
Now that you understand how to work with the documentation system in MkSaaS, you might want to explore these related features: