diff options
| author | tjp <tjp@ctrl-c.club> | 2024-01-03 19:05:21 -0700 |
|---|---|---|
| committer | tjp <tjp@ctrl-c.club> | 2024-01-03 19:05:21 -0700 |
| commit | 1eec3cbbc2da95e116e70ab3911766886e499988 (patch) | |
| tree | 5a8826e58d61e26ae4efbd75292dd702ed1ca20a | |
| parent | d2b94e4b874aa2639bb22eb88494cdda73d40f22 (diff) | |
about, and unlicense
| -rw-r--r-- | LICENSE.txt | 24 | ||||
| -rw-r--r-- | README.gmi | 43 | ||||
| -rw-r--r-- | actions.go | 34 | ||||
| -rw-r--r-- | command.go | 6 | ||||
| -rw-r--r-- | help.go | 9 |
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> @@ -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 @@ -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 @@ -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": @@ -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] ------ |
