You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
phetch/src/help.rs

187 lines
4.6 KiB
Rust

use bookmarks;
5 years ago
use history;
pub fn lookup(name: &str) -> Option<String> {
Some(match name {
"" | "/" | "home" | "home/" => format!("{}{}", HEADER, HOME),
"help" | "help/" => format!("{}{}", HEADER, HELP),
"history" => history::as_raw_menu(),
"bookmarks" => bookmarks::as_raw_menu(),
"help/keys" => format!("{}{}", HEADER, KEYS),
"help/nav" => format!("{}{}", HEADER, NAV),
"help/types" => format!("{}{}", HEADER, TYPES),
"help/bookmarks" => format!("{}{}", HEADER, BOOKMARKS),
"help/history" => format!("{}{}", HEADER, HISTORY),
5 years ago
_ => return None,
})
5 years ago
}
5 years ago
pub const HEADER: &str = "
5 years ago
i /spacer
5 years ago
i / / /
i ___ (___ ___ (___ ___ (___
i| )| )|___)| | | )
i|__/ | / |__ |__ |__ | /
i|
i
5 years ago
";
pub const HOME: &str = "
5 years ago
i~ the quick lil gopher client ~
i
7search gopher /v2/vs gopher.floodgap.com
1welcome to gopherspace /gopher gopher.floodgap.com
5 years ago
1the gopher project / gopherproject.org
5 years ago
1gopher lawn /lawn bitreich.org
i
i ~ * ~
i
1show help \x1b[90mctrl-h /help phetch
1show history \x1b[90mctrl-a /history phetch
1show bookmarks \x1b[90mctrl-b /bookmarks phetch
5 years ago
i\x1b[0m
5 years ago
";
5 years ago
pub const HELP: &str = "
5 years ago
i ** help topics **
5 years ago
i
1keyboard shortcuts /help/keys phetch
1menu navigation /help/nav phetch
1gopher types /help/types phetch
1bookmarks /help/bookmarks phetch
1history /help/history phetch
5 years ago
i
i ~ * ~
5 years ago
i
1start screen /home phetch
5 years ago
hphetch webpage URL:https://github.com/dvkt/phetch
i
";
pub const KEYS: &str = "
i ** keyboard shortcuts **
5 years ago
i
5 years ago
i\x1b[95mleft \x1b[96mback in history
5 years ago
i\x1b[95mright \x1b[96mnext in history
5 years ago
i\x1b[95mup \x1b[96mselect prev link
i\x1b[95mdown \x1b[96mselect next link
i\x1b[95mpage up \x1b[96mscroll page up
i\x1b[95mpage down \x1b[96mscroll page down
i
5 years ago
i\x1b[95mnum key \x1b[96mopen/select link
i\x1b[95menter \x1b[96mopen current link
5 years ago
i\x1b[95mescape \x1b[96mcancel
5 years ago
i
i\x1b[95mctrl-g \x1b[96mgo to gopher url
i\x1b[95mctrl-u \x1b[96mshow gopher url
5 years ago
i\x1b[95mctrl-y \x1b[96mcopy url
5 years ago
i\x1b[95mctrl-r \x1b[96mview raw source
5 years ago
i\x1b[95mctrl-w \x1b[96mtoggle wide mode
5 years ago
i
5 years ago
i\x1b[95mctrl-a \x1b[96mshow history
5 years ago
i\x1b[95mctrl-b \x1b[96mshow bookmarks
5 years ago
i\x1b[95mctrl-s \x1b[96msave bookmark
5 years ago
i\x1b[0m
5 years ago
";
5 years ago
pub const NAV: &str = "
i ** menu navigation **
i
ithere are three ways to navigate
imenus in phetch:
i
1up & down arrows /help/nav phetch
5 years ago
i
iuse the up and down arrows or the
ictrl-p/ctrl-n combos to select menu
iitems. phetch will scroll for you,
5 years ago
ior you can use page up & page down
i(or - and spacebar) to jump by many
ilines quickly.
5 years ago
i
1number keys /help/nav phetch
5 years ago
i
iif there are few enough menu items,
ipressing a number key will open the
iitem immediately. otherwise, it'll
5 years ago
ibe selected. use enter to open it.
5 years ago
i
1incremental search /help/nav phetch
5 years ago
i
ijust start typing. phetch will look
ifor the first case insensitive match
5 years ago
iand try to select it. use the arrow
ior ctrl-p/n keys to cycle matches.
5 years ago
i
";
pub const BOOKMARKS: &str = "
i ** bookmarks **
i
iphetch includes two ways to save
ithe current url:
i
i\x1b[95mctrl-y \x1b[96mcopy url
i\x1b[95mctrl-s \x1b[96msave bookmark
i\x1b[0m
iif the ~/.config/phetch/ directory
iexists, bookmarks will be saved to
i~/.config/phetch/bookmarks.gph
i
iuse ctrl-b to view them at any time.
i
ithe clipboard function uses:
i
i- `pbcopy` on macos
i- `xclip -sel clip` on linux
i";
pub const HISTORY: &str = "
i ** history **
i
iif you create a history.gph file
iin ~/.config/phetch/, each url
iyou visit will be store there.
i
inew urls are appended to the
ibottom, but loaded in reverse
iorder so you'll see the most
irecently visited pages first
iwhen you use ctrl-a.
i
ifeel free to edit your history
ifile directly, or share it with
iyour friends!
";
5 years ago
pub const TYPES: &str = "
i ** gopher types **
i
iphetch supports these links:
i
0text files /Mirrors/RFC/rfc1436.txt fnord.one 65446
1menu items /lawn/ascii bitreich.org
3errors /help/types phetch
7search servers / forthworks.com 7001
8telnet links /help/types phetch
hexternal urls URL:https://en.wikipedia.org/wiki/Phetch phetch
5 years ago
i
iand these download types:
i
4binhex /help/types phetch
5dosfiles /help/types phetch
6uuencoded files /help/types phetch
9binaries /help/types phetch
gGIFs /help/types phetch
Iimages downloads /help/types phetch
ssound files /help/types phetch
ddocuments /help/types phetch
5 years ago
i
iphetch does not support:
i
2CSO Entries /help/types phetch
+Mirrors /help/types phetch
TTelnet3270 /help/types phetch
5 years ago
i
";