diff --git a/docs/api.xml b/docs/api.xml deleted file mode 100644 index df6731f4b..000000000 --- a/docs/api.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - Submits a post. - - - - - - The posts title. :emojis: will be parsed as well. Plaintext. No markdown. - - - - - Post URL. Be wary of duplicates. - - - - - The post in markdown. - - - - - - - - The post you were looking for. - - - - - - - { - "our": "example, here", - "our": "example, here" - } - - - - - - - Not found - - - - - - - - - - - - Sends a user a message - - - - - - User URL - - - - - Message data to the user. - - - - - - - - - - - - - - - - - - { - } - - - - - - - - - - - - - - - - - - Creates a comment on a post, or replies to a comment - - - - - - ID of the parent post. Starts with p_ for a parent submission, and c_ for a comment submission. Anything else will emit a 400. - - - - - Parent submission (the id, right?) - - - - - Your messages content - - - - - Parent submission (the id, right?) - - - - - If this post is marked as sensitive. - - - - - - - - - - - - - - - - { - } - - - - - - - - - - - - User is exiled from the hole, or needs extra permissions. - User is banned and needs to do better. - - - - - - - - - - - - diff --git a/files/routes/docs.py b/files/routes/docs.py deleted file mode 100644 index e8d3e7971..000000000 --- a/files/routes/docs.py +++ /dev/null @@ -1,13 +0,0 @@ -import xml -import xml.etree.ElementTree as ET -from files.__main__ import app, cache, limiter - -tree = ET.parse('docs/api.xml') - -@app.get("/dev/api") -@auth_desired -def get_docs_page(): - # TODO cache - root = tree.getroot() - - return render_template("docs.html", root=tree.getroot()) diff --git a/files/templates/docs.html b/files/templates/docs.html deleted file mode 100644 index 272859049..000000000 --- a/files/templates/docs.html +++ /dev/null @@ -1,81 +0,0 @@ -{% extends "default.html" %} - -{#% Some macros %#} -{% macro docbook_read(info) -%} - {% for p in info -%} - {#% Lazy hack, not """conforming""" to docbook %#} -

- {{- p.text -}} -

- {%- endfor %} -{%- endmacro %} - -{%- macro param_table(info) -%} - - - - - - - - - {% for param in info %} - - - - - - - - - {% endfor %} -
ParamDescriptionTypeFormatRequired
{{ param.attrib.name }}{{- docbook_read(param[0]) -}}{{ param.attrib.type }}{{ param.attrib.style }}{{ param.attrib.required }}
-{%- endmacro -%} - -{% block pagetitle %}Documentation{% endblock %} -{% block content %} -
-

rDrama REST Api Documentaion

- -

Warning: This documentation is SHIT, so get - used to it

- -

You're probably here because you want to create your own application - which calls our REST api. Some of the stuff you see here might seem - ugly (it is), but it's mainly inherited from the old Ruqqus API.

- -

This documentation is generated from an XML WADL file.

- -
- - {% for res in root[0] %} -
- {#% There's usually only one method, but this is more correct %#} - {% for method in res %} -

- - {{- method.attrib.name -}} - - {{ res.attrib.path }} -

- {% for info in method %} - {% if info.tag == "{http://wadl.dev.java.net/2009/02}doc" %} - {{ docbook_read(info) }} - {% elif info.tag == "{http://wadl.dev.java.net/2009/02}request" %} - {{ param_table(info) }} - {% elif info.tag == "{http://wadl.dev.java.net/2009/02}response" %} -

Response {{ info.attrib.status }}

- {% for response_child in info %} - {% if response_child.tag == "{http://wadl.dev.java.net/2009/02}param" %} - {{ param_table(info) }} - {% elif response_child.tag == "{http://wadl.dev.java.net/2009/02}doc" %} - {{ docbook_read(response_child) }} - {% endif %} - {% endfor %} - {% endif %} - {% endfor %} - {% endfor %} -
- {% endfor %} -
-{% endblock %}