Blame


1 86395f5c 2021-03-02 op /*
2 86395f5c 2021-03-02 op * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
3 86395f5c 2021-03-02 op *
4 86395f5c 2021-03-02 op * Permission to use, copy, modify, and distribute this software for any
5 86395f5c 2021-03-02 op * purpose with or without fee is hereby granted, provided that the above
6 86395f5c 2021-03-02 op * copyright notice and this permission notice appear in all copies.
7 86395f5c 2021-03-02 op *
8 86395f5c 2021-03-02 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 86395f5c 2021-03-02 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 86395f5c 2021-03-02 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 86395f5c 2021-03-02 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 86395f5c 2021-03-02 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 86395f5c 2021-03-02 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 86395f5c 2021-03-02 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 86395f5c 2021-03-02 op */
16 86395f5c 2021-03-02 op
17 c25ddde1 2021-06-19 op #include "telescope.h"
18 86395f5c 2021-03-02 op
19 86395f5c 2021-03-02 op #define ASCII_ART \
20 86395f5c 2021-03-02 op "```An Ascii art of the word \"Telescope\"\n" \
21 86395f5c 2021-03-02 op " _______ __\n" \
22 86395f5c 2021-03-02 op "|_ _|.-----.| |.-----.-----.----.-----.-----.-----.\n" \
23 86395f5c 2021-03-02 op " | | | -__|| || -__|__ --| __| _ | _ | -__|\n" \
24 86395f5c 2021-03-02 op " |___| |_____||__||_____|_____|____|_____| __|_____|\n" \
25 86395f5c 2021-03-02 op " |__|\n" \
26 86395f5c 2021-03-02 op "```\n"
27 86395f5c 2021-03-02 op
28 81ea92ab 2021-03-08 op #define CIRCUMLUNAR_SPACE "gemini://gemini.circumlunar.space"
29 81ea92ab 2021-03-08 op
30 1b412079 2021-06-19 op const char *about_about =
31 1b412079 2021-06-19 op "# About pages\n"
32 1b412079 2021-06-19 op "\n"
33 1b412079 2021-06-19 op "Telescope has a number of \"special\" pages under `about:':\n"
34 1b412079 2021-06-19 op "\n"
35 1b412079 2021-06-19 op "=> about:about about:about : this page\n"
36 1b412079 2021-06-19 op "=> about:blank about:blank : a blank page\n"
37 1b412079 2021-06-19 op "=> about:bookmarks about:bookmarks : the bookmarks page\n"
38 1b412079 2021-06-19 op "=> about:help about:help : help page\n"
39 1b412079 2021-06-19 op "=> about:new about:new : the default new tab page\n"
40 1b412079 2021-06-19 op "\n"
41 1b412079 2021-06-19 op "These pages are built-in and don't require an internet connection.\n"
42 1b412079 2021-06-19 op ;
43 1b412079 2021-06-19 op
44 1b412079 2021-06-19 op const char *about_blank = "\n";
45 1b412079 2021-06-19 op
46 1b412079 2021-06-19 op const char *about_help =
47 1b412079 2021-06-19 op "# Help\n"
48 1b412079 2021-06-19 op "\n"
49 1b412079 2021-06-19 op "## What is Gemini?\n"
50 1b412079 2021-06-19 op "\n"
51 1b412079 2021-06-19 op "Gemini is a new internet protocol which:\n"
52 1b412079 2021-06-19 op "\n"
53 1b412079 2021-06-19 op "* is heavier than gopher\n"
54 1b412079 2021-06-19 op "* is lighter than the web\n"
55 1b412079 2021-06-19 op "* will not replace either\n"
56 1b412079 2021-06-19 op "* strives for maximum power to weight ratio\n"
57 1b412079 2021-06-19 op "* takes user privacy very seriously\n"
58 1b412079 2021-06-19 op "\n"
59 67679476 2021-06-20 op "=> gemini://gemini.circumlunar.space Project Gemini Homepage\n"
60 1b412079 2021-06-19 op "\n"
61 a38a5d13 2021-06-24 op "> Tip: to navigate forward and backward in the history, use"
62 a38a5d13 2021-06-24 op " `C-M-b' and `C-M-f' (or `H' and `L').\n"
63 a38a5d13 2021-06-24 op "\n"
64 67679476 2021-06-20 op "> Tip: move the cursor over a link and press M-RET (alt-enter) to"
65 67679476 2021-06-20 op " open it in another tab. Then use `C-x t n' and `C-x t p'"
66 67679476 2021-06-20 op " (or `g t' and `g T') to switch between tabs.\n"
67 67679476 2021-06-20 op "\n"
68 67679476 2021-06-20 op "\n"
69 1b412079 2021-06-19 op "## What is Telescope?\n"
70 1b412079 2021-06-19 op "\n"
71 67679476 2021-06-20 op "Telescope is a Gemini browser written for fun, as hobbystic project"
72 67679476 2021-06-20 op " in my free time. As such, it lacks a ton of features you'll find in"
73 67679476 2021-06-20 op " more mature Gemini browsers, but it also has some unique features.\n"
74 1b412079 2021-06-19 op "\n"
75 67679476 2021-06-20 op "The UI is strongly inspired from Emacs and W3M, so you'll find some"
76 67679476 2021-06-20 op " familiar concepts, such as the minibuffer or the tabline, but care"
77 67679476 2021-06-20 op " has been taken to make it as familiar as possible for vi and CUA"
78 67679476 2021-06-20 op " users too.\n"
79 1b412079 2021-06-19 op "\n"
80 67679476 2021-06-20 op "=> gemini://telescope.omarpolo.com Telescope Project Homepage\n"
81 67679476 2021-06-20 op "\n"
82 67679476 2021-06-20 op "Telescope is documented very carefully in its manpage:\n"
83 67679476 2021-06-20 op "\n"
84 1b412079 2021-06-19 op "> man telescope\n"
85 1b412079 2021-06-19 op "\n"
86 1b412079 2021-06-19 op "\n"
87 1b412079 2021-06-19 op "## Tips\n"
88 1b412079 2021-06-19 op "\n"
89 1b412079 2021-06-19 op "### Appearance\n"
90 1b412079 2021-06-19 op "\n"
91 dd2c34ba 2021-06-19 op "Telescope is fully customizable. The default configuration file is\n"
92 1b412079 2021-06-19 op "\n"
93 dd2c34ba 2021-06-19 op "> ~/.telescope/config\n"
94 5c57b212 2021-06-19 op "\n"
95 dd2c34ba 2021-06-19 op "If your terminal emulator doesn't have problems with UTF-8 glyphs,"
96 dd2c34ba 2021-06-19 op " try to load Telescope with the following configuration:\n"
97 dd2c34ba 2021-06-19 op "\n"
98 dd2c34ba 2021-06-19 op "``` Example of configuration file with some pretty defaults\n"
99 1b412079 2021-06-19 op "# pretty prefixes\n"
100 1b412079 2021-06-19 op "style line.item {\n"
101 6322dee3 2021-06-21 op " prefix \" • \" \" \"\n"
102 1b412079 2021-06-19 op "}\n"
103 1b412079 2021-06-19 op "\n"
104 1b412079 2021-06-19 op "style line.link {\n"
105 6322dee3 2021-06-21 op " prefix \"→ \" \" \"\n"
106 a38a5d13 2021-06-24 op " fg blue\n"
107 a38a5d13 2021-06-24 op " attr normal underline\n"
108 1b412079 2021-06-19 op "}\n"
109 1b412079 2021-06-19 op "\n"
110 1b412079 2021-06-19 op "style line.quote {\n"
111 2dd1e060 2021-06-19 op " prefix \" ┃ \"\n"
112 1b412079 2021-06-19 op "}\n"
113 1b412079 2021-06-19 op "```\n"
114 1b412079 2021-06-19 op ;
115 1b412079 2021-06-19 op
116 86395f5c 2021-03-02 op const char *about_new =
117 86395f5c 2021-03-02 op ASCII_ART
118 86395f5c 2021-03-02 op "\n"
119 81ea92ab 2021-03-08 op "=> " CIRCUMLUNAR_SPACE "/docs Gemini documentation\n"
120 81ea92ab 2021-03-08 op "=> " CIRCUMLUNAR_SPACE "/software Gemini software\n"
121 81ea92ab 2021-03-08 op "\n"
122 7c698b4f 2021-04-11 op "=> gemini://geminispace.info/ Gemini Search engine\n"
123 81ea92ab 2021-03-08 op "\n"
124 86395f5c 2021-03-02 op "Version: " VERSION "\n"
125 86395f5c 2021-03-02 op "Bug reports to: " PACKAGE_BUGREPORT "\n"
126 5c57b212 2021-06-19 op "\n"
127 5c57b212 2021-06-19 op "=> " PACKAGE_URL " Telescope project page\n"
128 5c57b212 2021-06-19 op "=> about:help Help\n"
129 86395f5c 2021-03-02 op ;
130 0972d8b2 2021-03-02 op
131 5cd2ebb1 2021-03-11 op /* XXX: keep in sync with telescope.c:/^normalize_code/ */
132 0972d8b2 2021-03-02 op const char *err_pages[70] = {
133 0972d8b2 2021-03-02 op [CANNOT_FETCH] = "# Couldn't load the page\n",
134 0972d8b2 2021-03-02 op [TOO_MUCH_REDIRECTS] = "# Too much redirects\n",
135 5cd2ebb1 2021-03-11 op [MALFORMED_RESPONSE] = "# Got a malformed response\n",
136 c07ac996 2021-03-12 op [UNKNOWN_TYPE_OR_CSET] = "# Unsupported type or charset\n",
137 0972d8b2 2021-03-02 op
138 5cd2ebb1 2021-03-11 op [10] = "# Input required\n",
139 5cd2ebb1 2021-03-11 op [11] = "# Input required\n",
140 0972d8b2 2021-03-02 op [40] = "# Temporary failure\n",
141 0972d8b2 2021-03-02 op [41] = "# Server unavailable\n",
142 0972d8b2 2021-03-02 op [42] = "# CGI error\n",
143 0972d8b2 2021-03-02 op [43] = "# Proxy error\n",
144 0972d8b2 2021-03-02 op [44] = "# Slow down\n",
145 0972d8b2 2021-03-02 op [50] = "# Permanent failure\n",
146 0972d8b2 2021-03-02 op [51] = "# Not found\n",
147 0972d8b2 2021-03-02 op [52] = "# Gone\n",
148 0972d8b2 2021-03-02 op [53] = "# Proxy request refused\n",
149 0972d8b2 2021-03-02 op [59] = "# Bad request\n",
150 0972d8b2 2021-03-02 op [60] = "# Client certificate required\n",
151 0972d8b2 2021-03-02 op [61] = "# Certificate not authorised\n",
152 0972d8b2 2021-03-02 op [62] = "# Certificate not valid\n"
153 0972d8b2 2021-03-02 op };