mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-23 15:08:00 +00:00
Compare commits
4 commits
71e1503542
...
8a5a13f516
Author | SHA1 | Date | |
---|---|---|---|
8a5a13f516 | |||
594af5658b | |||
7673920141 | |||
2093af8217 |
|
@ -7,7 +7,7 @@
|
||||||
%a.endpoint(id="{{method.name.replace('handle_', '')}}" href="#{{method.name.replace('handle_', '')}}")
|
%a.endpoint(id="{{method.name.replace('handle_', '')}}" href="#{{method.name.replace('handle_', '')}}")
|
||||||
{{method.method.upper()}} {{method.path}}
|
{{method.method.upper()}} {{method.path}}
|
||||||
|
|
||||||
%span.description -> =method.docs
|
.description -> -markdown -> =method.docs
|
||||||
|
|
||||||
-if method.parameters
|
-if method.parameters
|
||||||
.parameters
|
.parameters
|
||||||
|
@ -19,5 +19,5 @@
|
||||||
-if not param.has_default
|
-if not param.has_default
|
||||||
%span.required << *required
|
%span.required << *required
|
||||||
|
|
||||||
.doc -> =param.docs
|
.doc -> -markdown -> =param.docs
|
||||||
|
|
||||||
|
|
|
@ -405,6 +405,10 @@ textarea {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#content.page-api_documentation .parameter .doc {
|
||||||
|
margin: 5px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
#content.page-api_documentation .parameter:not(:first-child) {
|
#content.page-api_documentation .parameter:not(:first-child) {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
|
|
|
@ -20,7 +20,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
|
|
||||||
class Template(Environment):
|
class Template(Environment):
|
||||||
_render_markdown: Callable[[str], str]
|
render_markdown: Callable[[str], str]
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, app: Application):
|
def __init__(self, app: Application):
|
||||||
|
@ -58,10 +58,6 @@ class Template(Environment):
|
||||||
return self.get_template(path).render(new_context)
|
return self.get_template(path).render(new_context)
|
||||||
|
|
||||||
|
|
||||||
def render_markdown(self, text: str) -> str:
|
|
||||||
return self._render_markdown(text)
|
|
||||||
|
|
||||||
|
|
||||||
class MarkdownExtension(Extension):
|
class MarkdownExtension(Extension):
|
||||||
tags = {'markdown'}
|
tags = {'markdown'}
|
||||||
extensions = (
|
extensions = (
|
||||||
|
@ -75,7 +71,7 @@ class MarkdownExtension(Extension):
|
||||||
Extension.__init__(self, environment)
|
Extension.__init__(self, environment)
|
||||||
self._markdown = Markdown(extensions = MarkdownExtension.extensions)
|
self._markdown = Markdown(extensions = MarkdownExtension.extensions)
|
||||||
environment.extend(
|
environment.extend(
|
||||||
_render_markdown = self._render_markdown
|
render_markdown = self._render_markdown
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,9 @@ async def handle_authorize_get(
|
||||||
client_id: str,
|
client_id: str,
|
||||||
redirect_uri: str) -> Response:
|
redirect_uri: str) -> Response:
|
||||||
"""
|
"""
|
||||||
Authorize an application. Redirects to the application's redirect URI if accepted.
|
Authorize an application.
|
||||||
|
|
||||||
|
Redirects to the application's redirect URI if accepted.
|
||||||
|
|
||||||
:param response_type: What to respond with. Should always be set to ``code``.
|
:param response_type: What to respond with. Should always be set to ``code``.
|
||||||
:param client_id: Application identifier
|
:param client_id: Application identifier
|
||||||
|
|
|
@ -53,7 +53,7 @@ def parse_docstring(docstring: str) -> tuple[str, dict[str, str]]:
|
||||||
body = cast(str, ds.short_description)
|
body = cast(str, ds.short_description)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
body = "\n".join([ds.short_description, ds.long_description]) # type: ignore[list-item]
|
body = "\n\n".join([ds.short_description, ds.long_description]) # type: ignore[list-item]
|
||||||
|
|
||||||
return body, params
|
return body, params
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue