This repository has been archived on 2024-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
se-hub/lib/flask_autodoc/templates/autodoc_default.html
Sagi Dayan 278a39710a API: Added auto generated API documentation at /api/documentation
to implement this generator in every Path you want to document add the
following decorator:
@auto.doc()
2015-05-12 11:32:22 +03:00

76 lines
No EOL
2.3 KiB
HTML

<html>
<head>
<title>
{% if title is defined -%}
{{title}}
{% else -%}
Documentation
{% endif -%}
</title>
<style>
* {
margin: 0;
padding: 0;
font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
}
body {
margin: 10px;
}
div.mapping {
margin: 20px 20px;
}
ul.methods:before { content: "Methods: "; }
ul.methods li {
display: inline;
list-style: none;
}
ul.methods li:after { content: ","; }
ul.methods li:last-child:after { content: ""; }
ul.arguments:before { content: "Arguments: "; }
ul.arguments li {
display: inline;
list-style: none;
}
ul.arguments .argument { font-style:italic }
ul.arguments .default:not(:empty):before { content: "("; }
ul.arguments .default:not(:empty):after { content: ")"; }
ul.arguments li:after { content: ","; }
ul.arguments li:last-child:after { content: ""; }
.docstring:before { content: "Description: "; }
</style>
</head>
<body>
<h1>
{% if title is defined -%}
{{title}}
{% else -%}
Documentation
{% endif -%}
</h1>
{% for doc in autodoc %}
<div class="mapping">
<a id="rule-{{doc.rule|urlencode}}" class="rule"><h2>{{doc.rule|escape}}</h2></a>
<ul class="methods">
{% for method in doc.methods -%}
<li class="method">{{method}}</li>
{% endfor %}
</ul>
<ul class="arguments">
{% for arg in doc.args %}
<li>
<span class="argument">{{arg}}</span>
<span class="default">{{doc.defaults[arg]}}</span>
</li>
{% endfor %}
</ul>
<p class="docstring">{{doc.docstring|urlize|nl2br}}</p>
</div>
{% endfor %}
</body>
</html>