forked from adtac/relevant-xkcd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.go
97 lines (80 loc) · 2.38 KB
/
index.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package main
import (
"net/http"
"fmt"
)
func IndexHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
fmt.Fprintf(w, `
<html>
<style>
* {
font-family: monospace;
font-size: 13px;
width: 76ch;
}
.title, .item {
font-weight: bold;
padding-bottom: 6px;
}
.title {
padding-top: 16px;
}
.content, .item-desc {
margin-left: 4ch;
}
.example {
padding-top: 4px;
}
</style>
<title>relevant-xkcd(7): a search engine for XKCD comics</title>
<div class='title'>relevant-xkcd(7)</div>
<div class='title'>NAME</div>
<div class='content'>
relevant-xkcd - a search engine for XKCD comics
</div>
<div class='title'>DESCRIPTION</div>
<div class='content'>
<div class='item'>POST /search</div>
<div class='item-desc'>search for the given term</div>
</div>
<div class='title'>EXAMPLE</div>
<div class='content'>
To search for the term 'velociraptors':
<div class='item-desc example'>
$ curl --data 'search=velociraptors' http://xkcd.adtac.pw/search
</div>
</div>
<div class='title'>AUTHOR</div>
<div class='content'>
<a href='https://adtac.github.io/'>Adhityaa (@adtac)</a>
</div>
<div class='title'>REPORTING BUGS</div>
<div class='content'>
Please use the <a href='https://github.com/adtac/relevant-xkcd/issues'>Github issue tracker</a> to file bugs. Note that this is feature-complete and will not be accepting new feature suggestions. Feel free to fork the code (while still adhering to the license agreement).
</div>
<div class='title'>COPYRIGHT</div>
<div class='content'>
Copyright (C) 2017 Adhityaa Chandrasekar<br>
<br>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.<br>
<br>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.<br>
<br>
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
<div class='title'>SEE ALSO</div>
<div class='content'>
<a href='https://relevant-xkcd.github.io/'>A pretty front-end for this API.</a>
</div>
</div>
</html>
`)
}