summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE.txt24
-rw-r--r--README.gmi43
-rw-r--r--actions.go34
-rw-r--r--command.go6
-rw-r--r--help.go9
5 files changed, 93 insertions, 23 deletions
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..fdddb29
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,24 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <https://unlicense.org>
diff --git a/README.gmi b/README.gmi
index 3c160c8..d03301d 100644
--- a/README.gmi
+++ b/README.gmi
@@ -1,30 +1,29 @@
# X-1: fly around the small web at the speed of sound
```ASCII art image of a Bell X-1 in flight
- ...
- *=:::.
- ---======- -+-.....
+ ...
+ *=:::.
+ ---======- -+-.....
.#@@@@@@@= .+=-:....:++
+@@@@@@@@# :-::.. ...*+
- :%@@@@@@@@@. =*+++==:....
- .*@@@@@@@@@@= -#%###**++-:..
- -@@@@@@@@@@@% .::-=*#@@#*#@@@@@@@%-.
- ..:::----=====++#@@@@@@@@@@@@%%%@@@@@@@@@@%%#**@@@@@@@=
- .-+#%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-
- =*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##%@@*%@@@@@@@@@@- ..
- -+*. .#@@@@@@@@@@@@@@@@@@@@@@@@@@@%@@@@@@%%%%###- =- .=.==----==--:...
-...:::::=#@@@@#**+*##@@@#*%%%%%%%%##############******+==-:-=-:.-==-:.. ...
- .:.:-==++++====::-----::---:-+%@@@@@@@@@@@@@#-...
- . ...............=@@@@@@@@@@@@@@+....
- -@@@@@@@@@@@@@#.
- -@@@@@@@@@@@@%-
- -@@%%##@@@@@@=
- =%++*=-=%@@@*.
- =--*%%%::#@#:
- *@+=#-+*%@%-
- .*%****###@+.
- ::..:::.::*@@@%%%%%#:
-
+ :%@@@@@@@@@. =*+++==:....
+ .*@@@@@@@@@@= -#%###**++-:..
+ -@@@@@@@@@@@% .::-=*#@@#*#@@@@@@@%-.
+ ..:::----=====++#@@@@@@@@@@@@%%%@@@@@@@@@@%%#**@@@@@@@=
+ .-+#%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-
+ =*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##%@@*%@@@@@@@@@@- ..
+ -+*. .#@@@@@@@@@@@@@@@@@@@@@@@@@@@%@@@@@@%%%%###- =- .=.==----==--:...
+...:::::=#@@@@#**+*##@@@#*%%%%%%%%##############******+==-:-=-:.-==-:.. ...
+ .:.:-==++++====::-----::---:-+%@@@@@@@@@@@@@#-...
+ . ...............=@@@@@@@@@@@@@@+....
+ -@@@@@@@@@@@@@#.
+ -@@@@@@@@@@@@%-
+ -@@%%##@@@@@@=
+ =%++*=-=%@@@*.
+ =--*%%%::#@#:
+ *@+=#-+*%@%-
+ .*%****###@+.
+ ::..:::.::*@@@%%%%%#:
```
## Prior art
diff --git a/actions.go b/actions.go
index afb8289..c2dd934 100644
--- a/actions.go
+++ b/actions.go
@@ -37,6 +37,40 @@ var (
ErrInvalidTourArgs = errors.New("tour what?")
)
+func About(state *BrowserState) error {
+ _, err := fmt.Println(`
+ ...
+ *=:::.
+ ---======- -+-.....
+ .#@@@@@@@= .+=-:....:++
+ +@@@@@@@@# :-::.. ...*+
+ :%@@@@@@@@@. =*+++==:....
+ .*@@@@@@@@@@= -#%###**++-:..
+ -@@@@@@@@@@@% .::-=*#@@#*#@@@@@@@%-.
+ ..:::----=====++#@@@@@@@@@@@@%%%@@@@@@@@@@%%#**@@@@@@@=
+ .-+#%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-
+ =*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##%@@*%@@@@@@@@@@- ..
+ -+*. .#@@@@@@@@@@@@@@@@@@@@@@@@@@@%@@@@@@%%%%###- =- .=.==----==--:...
+...:::::=#@@@@#**+*##@@@#*%%%%%%%%##############******+==-:-=-:.-==-:.. ...
+ .:.:-==++++====::-----::---:-+%@@@@@@@@@@@@@#-...
+ . ...............=@@@@@@@@@@@@@@+....
+ -@@@@@@@@@@@@@#.
+ -@@@@@@@@@@@@%-
+ -@@%%##@@@@@@=
+ =%++*=-=%@@@*.
+ =--*%%%::#@#:
+ *@+=#-+*%@%-
+ .*%****###@+.
+ ::..:::.::*@@@%%%%%#:
+
+x-1 is a browser for small web protocols gemini, gopher, finger, spartan, and nex.
+It also has very limited support for HTTP[S].
+
+It was written by TJP and released to the public domain.
+`[1:])
+ return err
+}
+
func Navigate(state *BrowserState, target *url.URL, navIndex int, conf *Config) error {
hist := state.History
diff --git a/command.go b/command.go
index 5862a57..ea7ee7c 100644
--- a/command.go
+++ b/command.go
@@ -26,6 +26,10 @@ func ParseCommand(line string) (*Command, error) {
cmd, rest, _ := strings.Cut(line, " ")
switch line[0] {
+ case 'a':
+ if strings.HasPrefix("about", cmd) {
+ return &Command{Name: "about"}, nil
+ }
case 'r':
if strings.HasPrefix("root", cmd) {
return &Command{Name: "root"}, nil
@@ -257,6 +261,8 @@ func parseTourArgs(line string) ([]string, error) {
func RunCommand(conf *Config, cmd *Command, state *BrowserState) error {
switch cmd.Name {
+ case "about":
+ return About(state)
case "root":
return Root(state, true, conf)
case "Root":
diff --git a/help.go b/help.go
index 3de618b..16fda43 100644
--- a/help.go
+++ b/help.go
@@ -43,7 +43,8 @@ next previous
reload print pipe
help links history
tour mark
-go save quit
+go save
+about quit
Any command may be written as any prefix sufficiently long to be unique.
So for instance, "reload" can be specified by just typing "re". This is
@@ -263,6 +264,12 @@ The directory can be controlled with the "download_folder" option in the
config file, but defaults to the user's home directory.
`[1:],
+ "about": `
+a[bout]
+-------
+Displays a short page about the x-1 browser.
+`[1:],
+
"quit": `
q[uit]
------