Blob


1 /*
2 * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
17 #include "telescope.h"
19 #define ASCII_ART \
20 "```An Ascii art of the word \"Telescope\"\n" \
21 " _______ __\n" \
22 "|_ _|.-----.| |.-----.-----.----.-----.-----.-----.\n" \
23 " | | | -__|| || -__|__ --| __| _ | _ | -__|\n" \
24 " |___| |_____||__||_____|_____|____|_____| __|_____|\n" \
25 " |__|\n" \
26 "```\n"
28 #define CIRCUMLUNAR_SPACE "gemini://gemini.circumlunar.space"
30 const char *about_about =
31 "# About pages\n"
32 "\n"
33 "Telescope has a number of \"special\" pages under `about:':\n"
34 "\n"
35 "=> about:about about:about : this page\n"
36 "=> about:blank about:blank : a blank page\n"
37 "=> about:bookmarks about:bookmarks : the bookmarks page\n"
38 "=> about:help about:help : help page\n"
39 "=> about:new about:new : the default new tab page\n"
40 "\n"
41 "These pages are built-in and don't require an internet connection.\n"
42 ;
44 const char *about_blank = "\n";
46 const char *about_help =
47 "# Help\n"
48 "\n"
49 "## What is Gemini?\n"
50 "\n"
51 "Gemini is a new internet protocol which:\n"
52 "\n"
53 "* is heavier than gopher\n"
54 "* is lighter than the web\n"
55 "* will not replace either\n"
56 "* strives for maximum power to weight ratio\n"
57 "* takes user privacy very seriously\n"
58 "\n"
59 "\n"
60 "## What is Telescope?\n"
61 "\n"
62 "Telescope is a Gemini browser written for fun. Other than taking"
63 " user privacy very seriously, it also takes security and semplicity"
64 " very seriously.\n"
65 "\n"
66 "Telescope is documented very carefully: read the manual page for"
67 " more information:\n"
68 "\n"
69 "> man telescope\n"
70 "\n"
71 "\n"
72 "## Tips\n"
73 "\n"
74 "### Appearance\n"
75 "\n"
76 "Telescope is fully customizable. If your terminal emulator"
77 " doesn't have problems with UTF-8 glyphs, try to load"
78 " Telescope with the following configuration:\n"
79 "\n"
80 "``` Example of configuration file with some pretty defaults\n"
81 "# ~/.telescope/config\n"
82 "\n"
83 "# break paragraphs at most at the 72th column\n"
84 "set fill-column = 72\n"
85 "\n"
86 "# pretty prefixes\n"
87 "style line.item {\n"
88 " prefix \" • \"\n"
89 " cont \" \"\n"
90 "}\n"
91 "\n"
92 "style line.link {\n"
93 " prefix \"→ \"\n"
94 " cont \" \"\n"
95 "}\n"
96 "\n"
97 "style line.quote {\n"
98 " prefix \"» \"\n"
99 " cont \" \"\n"
100 "}\n"
101 "```\n"
104 const char *about_new =
105 ASCII_ART
106 "\n"
107 "=> " CIRCUMLUNAR_SPACE "/docs Gemini documentation\n"
108 "=> " CIRCUMLUNAR_SPACE "/software Gemini software\n"
109 "\n"
110 "=> gemini://geminispace.info/ Gemini Search engine\n"
111 "\n"
112 "Version: " VERSION "\n"
113 "Bug reports to: " PACKAGE_BUGREPORT "\n"
114 "\n"
115 "=> " PACKAGE_URL " Telescope project page\n"
116 "=> about:help Help\n"
119 /* XXX: keep in sync with telescope.c:/^normalize_code/ */
120 const char *err_pages[70] = {
121 [CANNOT_FETCH] = "# Couldn't load the page\n",
122 [TOO_MUCH_REDIRECTS] = "# Too much redirects\n",
123 [MALFORMED_RESPONSE] = "# Got a malformed response\n",
124 [UNKNOWN_TYPE_OR_CSET] = "# Unsupported type or charset\n",
126 [10] = "# Input required\n",
127 [11] = "# Input required\n",
128 [40] = "# Temporary failure\n",
129 [41] = "# Server unavailable\n",
130 [42] = "# CGI error\n",
131 [43] = "# Proxy error\n",
132 [44] = "# Slow down\n",
133 [50] = "# Permanent failure\n",
134 [51] = "# Not found\n",
135 [52] = "# Gone\n",
136 [53] = "# Proxy request refused\n",
137 [59] = "# Bad request\n",
138 [60] = "# Client certificate required\n",
139 [61] = "# Certificate not authorised\n",
140 [62] = "# Certificate not valid\n"
141 };