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 "> Tip: use the arrow keys, the page up/down keys, hjkl or C-{b,f,n,p}"
50 " to move the cursor and read the page.\n"
51 "\n"
52 "## What is Gemini?\n"
53 "\n"
54 "Gemini is a new internet protocol which:\n"
55 "\n"
56 "* is heavier than gopher\n"
57 "* is lighter than the web\n"
58 "* will not replace either\n"
59 "* strives for maximum power to weight ratio\n"
60 "* takes user privacy very seriously\n"
61 "\n"
62 "=> gemini://gemini.circumlunar.space Project Gemini Homepage\n"
63 "\n"
64 "> Tip: use `C-M-b' and `C-M-f' (or `H' and `L') to navigate "
65 " forward and backward in the history.\n"
66 "\n"
67 "> Tip: move the cursor over a link and press M-RET (alt-enter) to"
68 " open it in another tab. Then use `C-x t n' and `C-x t p'"
69 " (or `g t' and `g T') to switch between tabs.\n"
70 "\n"
71 "\n"
72 "## What is Telescope?\n"
73 "\n"
74 "Telescope is a Gemini browser written for fun, as hobbystic project"
75 " in my free time. As such, it lacks a ton of features you'll find in"
76 " more mature Gemini browsers, but it also has some unique ones.\n"
77 "\n"
78 "The UI is strongly inspired from Emacs and W3M, so you'll find some"
79 " familiar concepts, such as the minibuffer or the tabline, but care"
80 " has been taken to make it as familiar as possible for vi and CUA"
81 " users too.\n"
82 "\n"
83 "=> gemini://telescope.omarpolo.com Telescope Project Homepage\n"
84 "\n"
85 "Telescope is documented very carefully, so please check out the"
86 " manpage to know more:\n"
87 "\n"
88 "> man telescope\n"
89 "\n"
90 "\n"
91 "### Appearance\n"
92 "\n"
93 "Telescope is fully customizable. The default configuration file is\n"
94 "\n"
95 "> ~/.telescope/config\n"
96 "\n"
97 "If your terminal emulator doesn't have problems with UTF-8 glyphs,"
98 " try to load Telescope with the following configuration:\n"
99 "\n"
100 "``` Example of configuration file with some pretty defaults\n"
101 "# pretty prefixes\n"
102 "style line.item {\n"
103 " prefix \" • \" \" \"\n"
104 "}\n"
105 "\n"
106 "style line.link {\n"
107 " prefix \"→ \" \" \"\n"
108 " fg blue\n"
109 " attr normal underline\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 };