Fix bugs, many other changes

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/mai/trunk@67 e410bdd4-646f-c54f-a7ce-fffcc4f439ae
This commit is contained in:
yakumo.izuru
2024-02-07 00:26:14 +00:00
parent 2435673dff
commit b860f0610b
22 changed files with 172 additions and 501 deletions

View File

@@ -7,49 +7,68 @@
<title>API Documentation | Mai</title>
</head>
<body id="body">
<h1 id="header">API Documentation</h1>
<br><hr>
<h2 class="get">[GET] /api/translate</h2>
<h2 class="post">[POST] /api/translate</h2>
<h3>Description</h3>
<p>Translation endpoint, input must be URL-encoded (e.g. multi-byte characters, words separated by space)</p>
<h3>Arguments</h3>
<ul>
<li>engine</li>
<li>from</li>
<li>text</li>
<li>to</li>
</ul>
<h3>Examples</h3>
<p><pre><code>GET /api/translate?engine=google&amp;from=auto&amp;to=en&amp;text="sonrisa"</code></pre></p>
<hr>
<h2 class="get">[GET] /api/source_languages</h2>
<h2 class="get">[GET] /api/target_languages</h2>
<h3>Description</h3>
<p>Get a JSON array of supported source and target languages for a particular engine</p>
<h3>Arguments</h3>
<ul>
<li>engine</li>
</ul>
<h3>Examples</h3>
<p><pre><code>GET /api/source_languages?engine=google</code></pre></p>
<p><pre><code>GET /api/target_languages?engine=google</code></pre></p>
<hr>
<h2 class="get">[GET] /api/tts</h2>
<h3>Description</h3>
<p>Obtain text-to-speech audio files from an engine, provided said engine supports them</p>
<h3>Arguments</h3>
<ul>
<li>engine</li>
<li>lang</li>
<li>text</li>
</ul>
<h3>Examples</h3>
<p><pre><code>GET /api/tts?engine=google&amp;lang=en&amp;text="hi"</code></pre></p>
<hr>
<h2 class="post">[POST] /switchlanguages</h2>
<h3>Description</h3>
<p>Switch between source and target languages, as long as the source language isn't "auto"</p>
<hr>
<h1>API documentation</h1>
<table border="1" align="center">
<tr>
<td>
<h2 class="get">[GET] /api/translate</h2>
<h2 class="post">[POST] /api/translate</h2>
<h3>Description</h3>
<p>Translation endpoint, input must be URL-encoded (e.g. multi-byte characters, words separated by space)</p>
<h3>Arguments</h3>
<ul>
<li>engine</li>
<li>from</li>
<li>text</li>
<li>to</li>
</ul>
</td>
</tr>
<tr>
<td>
<h2 class="get">[GET] /api/source_languages</h2>
<h2 class="get">[GET] /api/target_languages</h2>
<h3>Description</h3>
<p>Get a JSON array of supported source and target languages for a particular engine</p>
<h3>Arguments</h3>
<ul>
<li>engine</li>
</ul>
</td>
</tr>
<tr>
<td>
<h2 class="get">[GET] /api/tts</h2>
<h3>Description</h3>
<p>Obtain text-to-speech audio files from an engine, provided said engine supports them</p>
<h3>Arguments</h3>
<ul>
<li>engine</li>
<li>lang</li>
<li>text</li>
</ul>
</td>
</tr>
<tr>
<td>
<h2 class="get">[GET] /robots.txt</h2>
</td>
</tr>
<tr>
<td>
<h2 class="post">[POST] /switchlanguages</h2>
<h3>Description</h3>
<p>Switch between source and target languages, as long as the source language isn't "auto"</p>
<p>Must only be called inside the form interface</p>
</td>
</tr>
<tr>
<td>
<h2 class="get">[GET] /version</h2>
<h3>Description</h3>
<p>Return the software version as a JSON array</p>
</td>
</tr>
</table>
</body>
</html>