diff --git a/src/docgen/templates/markdown.md.jinja2 b/src/docgen/templates/markdown.md.jinja2 new file mode 100644 index 0000000..7b19ac8 --- /dev/null +++ b/src/docgen/templates/markdown.md.jinja2 @@ -0,0 +1,55 @@ +# {{ title }} + +{% if description %} +{{ description }} +{% endif %} + +**Version:** {{ version }} + +--- + +{% for tag, tag_endpoints in grouped_endpoints.items() %} +## {{ tag }} + +{% for endpoint in tag_endpoints %} +### {{ endpoint.method.value }} {{ endpoint.path }} + +{% if endpoint.summary %} +**{{ endpoint.summary }}** +{% endif %} + +{% if endpoint.description %} +{{ endpoint.description }} +{% endif %} + +{% if endpoint.parameters %} +#### Parameters + +| Name | Location | Type | Required | Description | +|------|----------|------|----------|-------------| +{% for param in endpoint.parameters %} +| `{{ param.name }}` | {{ param.location.value }} | {{ param.type }} | {{ 'Yes' if param.required else 'No' }} | {{ param.description }} | +{% endfor %} +{% endif %} + +{% if endpoint.responses %} +#### Responses + +| Status | Description | +|--------|-------------| +{% for response in endpoint.responses %} +| {{ response.status_code }} | {{ response.description }} | +{% endfor %} +{% endif %} + +{% if endpoint.file_path %} +> **Source:** {{ endpoint.file_path }}{% if endpoint.line_number %}:{{ endpoint.line_number }}{% endif %} + +{% endif %} +--- +{% endfor %} +{% endfor %} + +--- + +*Generated by DocGen-CLI*