This commit is contained in:
53
src/templates/markdown_template.md
Normal file
53
src/templates/markdown_template.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# {{ title }}
|
||||||
|
|
||||||
|
## API Reference
|
||||||
|
|
||||||
|
**Version:** {{ version }}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Endpoints
|
||||||
|
|
||||||
|
{% for endpoint in endpoints %}
|
||||||
|
### {{ endpoint.method }} {{ endpoint.path }}
|
||||||
|
|
||||||
|
{% if endpoint.deprecated %}
|
||||||
|
> **Deprecated**
|
||||||
|
|
||||||
|
{% endif %}{% if endpoint.summary %}
|
||||||
|
**{{ endpoint.summary }}**
|
||||||
|
|
||||||
|
{% endif %}{% if endpoint.description %}
|
||||||
|
{{ endpoint.description }}
|
||||||
|
|
||||||
|
{% endif %}{% if endpoint.tags %}
|
||||||
|
**Tags:** {% for tag in endpoint.tags %}`{{ tag }}` {% endfor %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Location | Required | Description |
|
||||||
|
|------|------|----------|----------|-------------|
|
||||||
|
{% for param in endpoint.parameters %}
|
||||||
|
| {{ param.name }} | {{ param.schema.type if param.schema else 'any' }} | {{ param.in }} | {{ 'Yes' if param.required else 'No' }} | {{ param.description or '-' }} |
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
#### Responses
|
||||||
|
|
||||||
|
| Status | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
{% for status, response in endpoint.responses.items() %}
|
||||||
|
| {{ status }} | {{ response.description }} |
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if endpoint.request_body %}
|
||||||
|
#### Request Body
|
||||||
|
|
||||||
|
```json
|
||||||
|
{{ endpoint.request_body|tojson }}
|
||||||
|
```
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
Reference in New Issue
Block a user