Overview
The CoCart API documentation is built with Mintlify, a modern documentation platform that uses MDX (Markdown + JSX) files and is hosted publicly on GitHub at cocart-headless/cocart-api-documentation.Ways to Contribute
You can help improve the documentation in several ways:Fix Typos & Errors
Correct spelling mistakes, grammar issues, or technical inaccuracies
Improve Clarity
Rewrite confusing sections to make them easier to understand
Add Examples
Contribute code examples in different programming languages
Write Tutorials
Create step-by-step guides for common use cases
Getting Started
Prerequisites
Before you begin, make sure you have:- A GitHub account
- Git installed on your computer
- Node.js (v18 or higher) installed
- Basic familiarity with Markdown and Git workflows
Setting Up Your Development Environment
- Fork the repository Visit the documentation repository and click the “Fork” button in the top-right corner.
- Clone your fork
- Install Mintlify CLI
- Start the development server
http://localhost:3000
.
If
mintlify dev
isn’t working, try running mintlify install
to reinstall dependencies.Documentation Structure
Understanding the project structure will help you navigate and contribute effectively:Key Files
- docs.json - Controls navigation, theme, and site settings
- MDX files - Content pages using Markdown with React components
- CLAUDE.md - Project-specific contribution guidelines
Writing Guidelines
Frontmatter Requirements
Every MDX file must include frontmatter with at least these fields:Writing Style
Follow these style guidelines for consistency:Voice and Tone
Voice and Tone
- Use second-person voice (“you”) when addressing the reader
- Keep tone professional but friendly
- Write in active voice
- Be concise and direct
Code Examples
Code Examples
- Include code examples for all procedural content
- Add language tags to all code blocks
- Test all code examples before submitting
- Include both basic and advanced use cases where appropriate
- Show examples in multiple languages when possible (JavaScript, PHP, cURL)
Links and References
Links and References
- Use relative paths for internal links:
[link text](/path/to/page)
- Use descriptive link text (avoid “click here”)
- Link to relevant sections for additional context
See [Authentication](/api-reference/authentication) for more details.
Bad: Click [here](https://docs.cocartapi.com/api-reference/authentication) for more information.
Structure
Structure
- Start procedural content with prerequisites
- Use clear headings to organize content
- Include “What You’ll Learn” or “Overview” sections for tutorials
- Add “Next Steps” or “What’s Next” sections where appropriate
Using Mintlify Components
Mintlify provides special components to enhance your documentation:Callouts
Use callouts to highlight important information:Cards
Create card layouts for organized content:Accordions
Use accordions for collapsible content:Code Groups
Show code in multiple languages using CodeGroup:For more components and options, see the Mintlify Components Documentation.
Contribution Workflow
Making Changes
-
Create a new branch
Branch naming conventions:
fix/short-description
- Bug fixes or correctionsadd/short-description
- New contentrefactor/short-description
- Reorganizing contentupdate/short-description
- Updating existing content
- Make your changes Edit MDX files in your preferred text editor. The local dev server will auto-reload as you make changes.
-
Preview your changes
Check
http://localhost:3000
to see how your changes look before committing. -
Update navigation (if adding new pages)
Add your new page to docs.json in the appropriate section:
Committing Changes
Follow these commit guidelines:1
Write clear commit messages
- Subject line: 50 characters or less, imperative mood
- Body: Wrap at 72 characters, explain what and why
- No period at end of subject line
2
Never skip pre-commit hooks
The repository may have pre-commit hooks for validation. Never use
--no-verify
flag.3
Commit frequently
Make small, atomic commits that each address one specific change.
Submitting Your Contribution
-
Push your branch to GitHub
-
Create a Pull Request
- Go to your fork on GitHub
- Click “Compare & pull request”
- Fill out the PR template with:
- Clear description of your changes
- Why the changes are needed
- Any related issues
-
Address review feedback
Maintainers may request changes. Make updates to your branch and push again:
Updating docs.json
The docs.json file controls navigation and site configuration. When updating it:Navigation Structure
The documentation has versioned navigation (stable and pre-release):Adding a New Page
When you add a new page, include it in the appropriate tab and group:Always validate your JSON syntax. Invalid JSON will break the entire documentation site.
docs.json Schema
Refer to the Mintlify docs.json schema for complete configuration options.Testing Your Changes
Before submitting a pull request:Content Strategy
When contributing content, keep these principles in mind:Just Enough
Document enough for user success - not too much, not too little
Accuracy First
Prioritize accuracy and usability over comprehensiveness
Evergreen Content
Write content that remains relevant over time when possible
Avoid Duplication
Search for existing info before adding new content
Common Mistakes to Avoid
Do NOT:
- Skip frontmatter on any MDX file
- Use absolute URLs for internal links
- Include untested code examples
- Make assumptions - ask for clarification instead
- Use
--no-verify
when committing - Modify changelog files directly (these are maintained by the CoCart team)
Getting Help
Need help with your contribution?- Questions about content: Ask in the #documentation channel on Discord
- Technical issues with Mintlify: Check the Mintlify documentation
- Report documentation issues: Open an issue on GitHub
Recognition
Contributors are valued members of the CoCart community! Significant contributions may be recognized:- Listed in documentation contributors
- Mentioned in release notes
- Invited to join the documentation team
Resources
Mintlify Docs
Official Mintlify documentation
MDX Docs
Learn about MDX syntax
CoCart Community
Join our Discord community
GitHub Repo
Documentation repository
What’s Next?
Ready to contribute? Here are some good starting points:- Look for pages tagged with “WIP” (work in progress) that need completion or reviewing before finalization and tagging as “NEW”
- Check the GitHub issues for documentation tasks
- Review recent changes to understand current documentation priorities
- Start with small improvements like fixing typos before tackling larger contributions