]> git.lizzy.rs Git - frontend-next.git/blob - src/routes/api.svelte
e167fa79937699c4eb5995720106ec9675bd97e5
[frontend-next.git] / src / routes / api.svelte
1 <!-- This file is part of api-worker <https://github.com/senpy-club/api-worker>.
2 Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, version 3.
7
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
17 SPDX-License-Identifier: GPL-3.0-only -->
18 <script>
19   import { onMount } from "svelte";
20   import rst2html from "rst2html";
21
22   let rst;
23   let complete = false;
24
25   onMount(async () => {
26     rst = await (await fetch("https://api.senpy.club")).text();
27     complete = true;
28   });
29 </script>
30
31 <svelte:head>
32   <title>API | The Senpy Club</title>
33 </svelte:head>
34
35 <section>
36   <h1>API</h1>
37
38   <p>This documentation is auto-generated, there may be errors.</p>
39
40   <p>
41     The Senpy Club API can be accessed at
42     <a href="https://api.senpy.club" target="_blank">https://api.senpy.club</a>.
43   </p>
44
45   {#if !complete}
46     <p>Fetching API README...</p>
47   {:else}
48     {@html rst2html(rst)}
49   {/if}
50 </section>