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 "=> gemini://gemini.circumlunar.space Project Gemini Homepage\n"
60 "\n"
61 "> Tip: move the cursor over a link and press M-RET (alt-enter) to"
62 " open it in another tab. Then use `C-x t n' and `C-x t p'"
63 " (or `g t' and `g T') to switch between tabs.\n"
64 "\n"
65 "\n"
66 "## What is Telescope?\n"
67 "\n"
68 "Telescope is a Gemini browser written for fun, as hobbystic project"
69 " in my free time. As such, it lacks a ton of features you'll find in"
70 " more mature Gemini browsers, but it also has some unique features.\n"
71 "\n"
72 "The UI is strongly inspired from Emacs and W3M, so you'll find some"
73 " familiar concepts, such as the minibuffer or the tabline, but care"
74 " has been taken to make it as familiar as possible for vi and CUA"
75 " users too.\n"
76 "\n"
77 "=> gemini://telescope.omarpolo.com Telescope Project Homepage\n"
78 "\n"
79 "Telescope is documented very carefully in its manpage:\n"
80 "\n"
81 "> man telescope\n"
82 "\n"
83 "\n"
84 "## Tips\n"
85 "\n"
86 "### Appearance\n"
87 "\n"
88 "Telescope is fully customizable. The default configuration file is\n"
89 "\n"
90 "> ~/.telescope/config\n"
91 "\n"
92 "Try to enable `olivetti-mode' with `M-x olivetti-mode RET' or with:\n"
93 "> set olivetti-mode = 1\n"
94 "in your config file.\n"
95 "\n"
96 "If your terminal emulator doesn't have problems with UTF-8 glyphs,"
97 " try to load Telescope with the following configuration:\n"
98 "\n"
99 "``` Example of configuration file with some pretty defaults\n"
100 "# break paragraphs at most at the 72th column\n"
101 "set fill-column = 72\n"
102 "\n"
103 "# pretty prefixes\n"
104 "style line.item {\n"
105 " prefix \" • \" \" \"\n"
106 "}\n"
107 "\n"
108 "style line.link {\n"
109 " prefix \"→ \" \" \"\n"
110 "}\n"
111 "\n"
112 "style line.quote {\n"
113 " prefix \" ┃ \"\n"
114 "}\n"
115 "```\n"
118 const char *about_new =
119 ASCII_ART
120 "\n"
121 "=> " CIRCUMLUNAR_SPACE "/docs Gemini documentation\n"
122 "=> " CIRCUMLUNAR_SPACE "/software Gemini software\n"
123 "\n"
124 "=> gemini://geminispace.info/ Gemini Search engine\n"
125 "\n"
126 "Version: " VERSION "\n"
127 "Bug reports to: " PACKAGE_BUGREPORT "\n"
128 "\n"
129 "=> " PACKAGE_URL " Telescope project page\n"
130 "=> about:help Help\n"
133 /* XXX: keep in sync with telescope.c:/^normalize_code/ */
134 const char *err_pages[70] = {
135 [CANNOT_FETCH] = "# Couldn't load the page\n",
136 [TOO_MUCH_REDIRECTS] = "# Too much redirects\n",
137 [MALFORMED_RESPONSE] = "# Got a malformed response\n",
138 [UNKNOWN_TYPE_OR_CSET] = "# Unsupported type or charset\n",
140 [10] = "# Input required\n",
141 [11] = "# Input required\n",
142 [40] = "# Temporary failure\n",
143 [41] = "# Server unavailable\n",
144 [42] = "# CGI error\n",
145 [43] = "# Proxy error\n",
146 [44] = "# Slow down\n",
147 [50] = "# Permanent failure\n",
148 [51] = "# Not found\n",
149 [52] = "# Gone\n",
150 [53] = "# Proxy request refused\n",
151 [59] = "# Bad request\n",
152 [60] = "# Client certificate required\n",
153 [61] = "# Certificate not authorised\n",
154 [62] = "# Certificate not valid\n"
155 };