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 1b412079 2021-06-19 op "\n"
60 1b412079 2021-06-19 op "## What is Telescope?\n"
61 1b412079 2021-06-19 op "\n"
62 1b412079 2021-06-19 op "Telescope is a Gemini browser written for fun. Other than taking"
63 1b412079 2021-06-19 op " user privacy very seriously, it also takes security and semplicity"
64 1b412079 2021-06-19 op " very seriously.\n"
65 1b412079 2021-06-19 op "\n"
66 1b412079 2021-06-19 op "Telescope is documented very carefully: read the manual page for"
67 1b412079 2021-06-19 op " more information:\n"
68 1b412079 2021-06-19 op "\n"
69 1b412079 2021-06-19 op "> man telescope\n"
70 1b412079 2021-06-19 op "\n"
71 1b412079 2021-06-19 op "\n"
72 1b412079 2021-06-19 op "## Tips\n"
73 1b412079 2021-06-19 op "\n"
74 1b412079 2021-06-19 op "### Appearance\n"
75 1b412079 2021-06-19 op "\n"
76 dd2c34ba 2021-06-19 op "Telescope is fully customizable. The default configuration file is\n"
77 1b412079 2021-06-19 op "\n"
78 dd2c34ba 2021-06-19 op "> ~/.telescope/config\n"
79 5c57b212 2021-06-19 op "\n"
80 dd2c34ba 2021-06-19 op "Try to enable `olivetti-mode' with `M-x olivetti-mode RET' or with:\n"
81 dd2c34ba 2021-06-19 op "> set olivetti-mode = 1\n"
82 dd2c34ba 2021-06-19 op "in your config file.\n"
83 dd2c34ba 2021-06-19 op "\n"
84 dd2c34ba 2021-06-19 op "If your terminal emulator doesn't have problems with UTF-8 glyphs,"
85 dd2c34ba 2021-06-19 op " try to load Telescope with the following configuration:\n"
86 dd2c34ba 2021-06-19 op "\n"
87 dd2c34ba 2021-06-19 op "``` Example of configuration file with some pretty defaults\n"
88 1b412079 2021-06-19 op "# break paragraphs at most at the 72th column\n"
89 1b412079 2021-06-19 op "set fill-column = 72\n"
90 1b412079 2021-06-19 op "\n"
91 1b412079 2021-06-19 op "# pretty prefixes\n"
92 1b412079 2021-06-19 op "style line.item {\n"
93 1b412079 2021-06-19 op " prefix \" • \"\n"
94 1b412079 2021-06-19 op " cont \" \"\n"
95 1b412079 2021-06-19 op "}\n"
96 1b412079 2021-06-19 op "\n"
97 1b412079 2021-06-19 op "style line.link {\n"
98 1b412079 2021-06-19 op " prefix \"→ \"\n"
99 1b412079 2021-06-19 op " cont \" \"\n"
100 1b412079 2021-06-19 op "}\n"
101 1b412079 2021-06-19 op "\n"
102 1b412079 2021-06-19 op "style line.quote {\n"
103 2dd1e060 2021-06-19 op " prefix \" ┃ \"\n"
104 2dd1e060 2021-06-19 op " cont \" ┃ \"\n"
105 1b412079 2021-06-19 op "}\n"
106 1b412079 2021-06-19 op "```\n"
107 1b412079 2021-06-19 op ;
108 1b412079 2021-06-19 op
109 86395f5c 2021-03-02 op const char *about_new =
110 86395f5c 2021-03-02 op ASCII_ART
111 86395f5c 2021-03-02 op "\n"
112 81ea92ab 2021-03-08 op "=> " CIRCUMLUNAR_SPACE "/docs Gemini documentation\n"
113 81ea92ab 2021-03-08 op "=> " CIRCUMLUNAR_SPACE "/software Gemini software\n"
114 81ea92ab 2021-03-08 op "\n"
115 7c698b4f 2021-04-11 op "=> gemini://geminispace.info/ Gemini Search engine\n"
116 81ea92ab 2021-03-08 op "\n"
117 86395f5c 2021-03-02 op "Version: " VERSION "\n"
118 86395f5c 2021-03-02 op "Bug reports to: " PACKAGE_BUGREPORT "\n"
119 5c57b212 2021-06-19 op "\n"
120 5c57b212 2021-06-19 op "=> " PACKAGE_URL " Telescope project page\n"
121 5c57b212 2021-06-19 op "=> about:help Help\n"
122 86395f5c 2021-03-02 op ;
123 0972d8b2 2021-03-02 op
124 5cd2ebb1 2021-03-11 op /* XXX: keep in sync with telescope.c:/^normalize_code/ */
125 0972d8b2 2021-03-02 op const char *err_pages[70] = {
126 0972d8b2 2021-03-02 op [CANNOT_FETCH] = "# Couldn't load the page\n",
127 0972d8b2 2021-03-02 op [TOO_MUCH_REDIRECTS] = "# Too much redirects\n",
128 5cd2ebb1 2021-03-11 op [MALFORMED_RESPONSE] = "# Got a malformed response\n",
129 c07ac996 2021-03-12 op [UNKNOWN_TYPE_OR_CSET] = "# Unsupported type or charset\n",
130 0972d8b2 2021-03-02 op
131 5cd2ebb1 2021-03-11 op [10] = "# Input required\n",
132 5cd2ebb1 2021-03-11 op [11] = "# Input required\n",
133 0972d8b2 2021-03-02 op [40] = "# Temporary failure\n",
134 0972d8b2 2021-03-02 op [41] = "# Server unavailable\n",
135 0972d8b2 2021-03-02 op [42] = "# CGI error\n",
136 0972d8b2 2021-03-02 op [43] = "# Proxy error\n",
137 0972d8b2 2021-03-02 op [44] = "# Slow down\n",
138 0972d8b2 2021-03-02 op [50] = "# Permanent failure\n",
139 0972d8b2 2021-03-02 op [51] = "# Not found\n",
140 0972d8b2 2021-03-02 op [52] = "# Gone\n",
141 0972d8b2 2021-03-02 op [53] = "# Proxy request refused\n",
142 0972d8b2 2021-03-02 op [59] = "# Bad request\n",
143 0972d8b2 2021-03-02 op [60] = "# Client certificate required\n",
144 0972d8b2 2021-03-02 op [61] = "# Certificate not authorised\n",
145 0972d8b2 2021-03-02 op [62] = "# Certificate not valid\n"
146 0972d8b2 2021-03-02 op };