84
src/docgen/templates/endpoint.html.jinja2
Normal file
84
src/docgen/templates/endpoint.html.jinja2
Normal file
@@ -0,0 +1,84 @@
|
||||
<div class="endpoint-header" onclick="toggleEndpoint(this)">
|
||||
<div class="endpoint-method-badge" style="background-color: {{ endpoint.get_method_color() }}">
|
||||
{{ endpoint.method.value }}
|
||||
</div>
|
||||
<div class="endpoint-path">
|
||||
<code>{{ endpoint.path }}</code>
|
||||
</div>
|
||||
<div class="endpoint-summary">
|
||||
{{ endpoint.summary or endpoint.description or '' }}
|
||||
</div>
|
||||
<div class="expand-icon">▼</div>
|
||||
</div>
|
||||
|
||||
<div class="endpoint-details">
|
||||
{% if endpoint.description %}
|
||||
<div class="endpoint-description">
|
||||
<h4>Description</h4>
|
||||
<p>{{ endpoint.description }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if endpoint.parameters %}
|
||||
<div class="parameters-section">
|
||||
<h4>Parameters</h4>
|
||||
<table class="parameters-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Location</th>
|
||||
<th>Type</th>
|
||||
<th>Required</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for param in endpoint.parameters %}
|
||||
<tr>
|
||||
<td><code>{{ param.name }}</code></td>
|
||||
<td><span class="param-location">{{ param.location.value }}</span></td>
|
||||
<td><code class="param-type">{{ param.type }}</code></td>
|
||||
<td>{{ 'Yes' if param.required else 'No' }}</td>
|
||||
<td>{{ param.description }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if endpoint.responses %}
|
||||
<div class="responses-section">
|
||||
<h4>Responses</h4>
|
||||
<div class="responses-list">
|
||||
{% for response in endpoint.responses %}
|
||||
<div class="response-item">
|
||||
<span class="response-status response-status-{{ (response.status_code // 100) * 100 }}xx">
|
||||
{{ response.status_code }}
|
||||
</span>
|
||||
<span class="response-description">{{ response.description }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="try-it-section">
|
||||
<h4>Try it out</h4>
|
||||
<div class="curl-generator">
|
||||
<button class="generate-curl-btn" onclick="generateCurl(event, '{{ endpoint.method.value }}', '{{ endpoint.path }}')">
|
||||
Generate cURL
|
||||
</button>
|
||||
<pre class="curl-output"><code></code></pre>
|
||||
<button class="copy-curl-btn" onclick="copyCurl(event)" style="display: none;">
|
||||
Copy
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if endpoint.file_path %}
|
||||
<div class="source-location">
|
||||
<small>Defined in: {{ endpoint.file_path }}{% if endpoint.line_number %}:{{ endpoint.line_number }}{% endif %}</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
Reference in New Issue
Block a user