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. The default configuration file is\n"
77 "\n"
78 "> ~/.telescope/config\n"
79 "\n"
80 "Try to enable `olivetti-mode' with `M-x olivetti-mode RET' or with:\n"
81 "> set olivetti-mode = 1\n"
82 "in your config file.\n"
83 "\n"
84 "If your terminal emulator doesn't have problems with UTF-8 glyphs,"
85 " try to load Telescope with the following configuration:\n"
86 "\n"
87 "``` Example of configuration file with some pretty defaults\n"
88 "# break paragraphs at most at the 72th column\n"
89 "set fill-column = 72\n"
90 "\n"
91 "# pretty prefixes\n"
92 "style line.item {\n"
93 " prefix \" • \"\n"
94 " cont \" \"\n"
95 "}\n"
96 "\n"
97 "style line.link {\n"
98 " prefix \"→ \"\n"
99 " cont \" \"\n"
100 "}\n"
101 "\n"
102 "style line.quote {\n"
103 " prefix \"» \"\n"
104 " cont \" \"\n"
105 "}\n"
106 "```\n"
109 const char *about_new =
110 ASCII_ART
111 "\n"
112 "=> " CIRCUMLUNAR_SPACE "/docs Gemini documentation\n"
113 "=> " CIRCUMLUNAR_SPACE "/software Gemini software\n"
114 "\n"
115 "=> gemini://geminispace.info/ Gemini Search engine\n"
116 "\n"
117 "Version: " VERSION "\n"
118 "Bug reports to: " PACKAGE_BUGREPORT "\n"
119 "\n"
120 "=> " PACKAGE_URL " Telescope project page\n"
121 "=> about:help Help\n"
124 /* XXX: keep in sync with telescope.c:/^normalize_code/ */
125 const char *err_pages[70] = {
126 [CANNOT_FETCH] = "# Couldn't load the page\n",
127 [TOO_MUCH_REDIRECTS] = "# Too much redirects\n",
128 [MALFORMED_RESPONSE] = "# Got a malformed response\n",
129 [UNKNOWN_TYPE_OR_CSET] = "# Unsupported type or charset\n",
131 [10] = "# Input required\n",
132 [11] = "# Input required\n",
133 [40] = "# Temporary failure\n",
134 [41] = "# Server unavailable\n",
135 [42] = "# CGI error\n",
136 [43] = "# Proxy error\n",
137 [44] = "# Slow down\n",
138 [50] = "# Permanent failure\n",
139 [51] = "# Not found\n",
140 [52] = "# Gone\n",
141 [53] = "# Proxy request refused\n",
142 [59] = "# Bad request\n",
143 [60] = "# Client certificate required\n",
144 [61] = "# Certificate not authorised\n",
145 [62] = "# Certificate not valid\n"
146 };