Documentation Guide¶
This guide explains how to maintain and extend the CurioPay API documentation.
Setup¶
The project uses MkDocs with the Material theme for documentation.
Prerequisites¶
To build the documentation locally, you need to install MkDocs and the Material theme:
Running Documentation Locally¶
Once installed, you can serve the documentation locally with:
This command will start a local server at http://localhost:8000 where you can preview the documentation.
Alternatively, you can use the direct MkDocs command:
Building Documentation¶
To build the static site:
Or with the direct MkDocs command:
This will create a site directory with the generated static HTML files.
Documentation Structure¶
The documentation is organized as follows:
docs/index.md: Main landing pagedocs/api/: API reference documentationdocs/architecture/: Architecture and design documentationdocs/development/: Development guides and proceduresdocs/deployment/: Deployment instructions
Adding New Pages¶
- Create a new Markdown file in the appropriate directory
- Add the file to the navigation in
mkdocs.yml:
Markdown Extensions¶
The documentation supports several Markdown extensions:
Code Blocks with Syntax Highlighting¶
Admonitions¶
!!! note "Optional Title"
This is a note admonition.
!!! warning "Warning"
This is a warning admonition.
Tables¶
API Documentation Best Practices¶
When documenting API endpoints:
- Always include the URL and HTTP method
- Document request parameters (path, query, body)
- Document response format and status codes
- Provide example requests and responses
- Document authentication requirements
- Include error responses
Example structure for an endpoint:
## Endpoint Name
Brief description of what the endpoint does.
**URL**: `/api/endpoint`
**Method**: `POST`
**Auth required**: Yes
### Request Body
```json
{
"field1": "value1",
"field2": "value2"
}
```
Success Response¶
Code: 200 OK
Error Response¶
Code: 400 BAD REQUEST