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 "config.h"
18 #include "pages.h"
20 #define ASCII_ART \
21 "```An Ascii art of the word \"Telescope\"\n" \
22 " _______ __\n" \
23 "|_ _|.-----.| |.-----.-----.----.-----.-----.-----.\n" \
24 " | | | -__|| || -__|__ --| __| _ | _ | -__|\n" \
25 " |___| |_____||__||_____|_____|____|_____| __|_____|\n" \
26 " |__|\n" \
27 "```\n"
29 #define CIRCUMLUNAR_SPACE "gemini://gemini.circumlunar.space"
31 const char *about_about =
32 "# About pages\n"
33 "\n"
34 "Telescope has a number of \"special\" built-in pages:\n"
35 "\n"
36 "=> about:about\n"
37 "=> about:blank\n"
38 "=> about:bookmarks\n"
39 "=> about:help\n"
40 "=> about:new\n"
41 "\n"
42 ;
44 const char *about_blank = "\n";
46 const char *about_help =
47 "# Help\n"
48 "\n"
49 "> Tip: use the arrow keys, page up/down, hjkl or C-{b,f,n,p} to move"
50 " the cursor and read the page.\n"
51 "\n"
52 "> Tip: to enter an URL and start browsing, type `>'.\n"
53 "\n"
54 "## What is Gemini?\n"
55 "\n"
56 "Gemini is a new internet protocol which:\n"
57 "\n"
58 "* is heavier than gopher\n"
59 "* is lighter than the web\n"
60 "* will not replace either\n"
61 "* strives for maximum power to weight ratio\n"
62 "* takes user privacy very seriously\n"
63 "\n"
64 "=> gemini://gemini.circumlunar.space Project Gemini Homepage\n"
65 "\n"
66 "> Tip: use `B' and `F' (or `H' and `L') to navigate"
67 " forward and backward in the history.\n"
68 "\n"
69 "> Tip: move the cursor over a link and press M-RET (alt-enter) to"
70 " open it in another tab. Then use `C-x t n' and `C-x t p'"
71 " (or `g t' and `g T') to switch between tabs.\n"
72 "\n"
73 "\n"
74 "## What is Telescope?\n"
75 "\n"
76 "Telescope is a Gemini browser written for fun, as hobbystic project"
77 " in my free time. As such, it lacks a ton of features you'll find in"
78 " more mature Gemini browsers, but it also has some unique ones.\n"
79 "\n"
80 "The UI is strongly inspired from Emacs and W3M, so you'll find some"
81 " familiar concepts, such as the minibuffer or the tabline, but care"
82 " has been taken to make it as familiar as possible for vi and CUA"
83 " users too.\n"
84 "\n"
85 "=> gemini://telescope.omarpolo.com Telescope Project Homepage\n"
86 "\n"
87 "Telescope is documented very carefully, so please check out the"
88 " manpage to know more:\n"
89 "\n"
90 "> man telescope\n"
91 "\n"
92 "=> gemini://gemini.omarpolo.com/cgi/man/telescope"
93 " Telescope man page in the gemini space.\n"
94 "\n"
95 "\n"
96 "### Appearance\n"
97 "\n"
98 "Telescope is fully customizable. The default configuration file is\n"
99 "\n"
100 "> ~/.telescope/config\n"
101 "\n"
102 "If your terminal emulator doesn't have problems with UTF-8 glyphs,"
103 " try to load Telescope with the following configuration:\n"
104 "\n"
105 "``` Example of configuration file with some pretty defaults\n"
106 "# pretty prefixes\n"
107 "style line.item {\n"
108 " prefix \" • \" \" \"\n"
109 "}\n"
110 "\n"
111 "style line.link {\n"
112 " prefix \"→ \" \" \"\n"
113 "}\n"
114 "\n"
115 "style line.quote {\n"
116 " prefix \" ┃ \"\n"
117 "}\n"
118 "```\n"
121 const char *about_new =
122 ASCII_ART
123 "\n"
124 "=> " CIRCUMLUNAR_SPACE "/docs Gemini documentation\n"
125 "=> " CIRCUMLUNAR_SPACE "/software Gemini software\n"
126 "=> gemini://geminispace.info/ Gemini Search Engine (geminispace.info)\n"
127 "\n"
128 "Version: " VERSION "\n"
129 "Bug reports to: " PACKAGE_BUGREPORT "\n"
130 "\n"
131 "=> " PACKAGE_URL " Telescope project page\n"
132 "=> about:help Help\n"
133 "=> about:about Internal Pages\n"
136 /* XXX: keep in sync with telescope.c:/^normalize_code/ */
137 const char *err_pages[70] = {
138 [CANNOT_FETCH] = "# Couldn't load the page\n",
139 [TOO_MUCH_REDIRECTS] = "# Too much redirects\n",
140 [MALFORMED_RESPONSE] = "# Got a malformed response\n",
141 [UNKNOWN_TYPE_OR_CSET] = "# Unsupported type or charset\n",
143 [10] = "# Input required\n",
144 [11] = "# Input required\n",
145 [40] = "# Temporary failure\n",
146 [41] = "# Server unavailable\n",
147 [42] = "# CGI error\n",
148 [43] = "# Proxy error\n",
149 [44] = "# Slow down\n",
150 [50] = "# Permanent failure\n",
151 [51] = "# Not found\n",
152 [52] = "# Gone\n",
153 [53] = "# Proxy request refused\n",
154 [59] = "# Bad request\n",
155 [60] = "# Client certificate required\n",
156 [61] = "# Certificate not authorised\n",
157 [62] = "# Certificate not valid\n"
158 };