tighten up

pull/6/head
dvkt 5 years ago
parent 88f7571352
commit 01956c5865

@ -3,7 +3,7 @@ use history;
pub fn lookup(name: &str) -> Option<String> { pub fn lookup(name: &str) -> Option<String> {
Some(match name { Some(match name {
"" | "/" | "home" | "home/" => format!("{}{}", HEADER, HOME), "" | "/" | "home" | "home/" => format!("{}{}", HEADER, START),
"help" | "help/" => format!("{}{}", HEADER, HELP), "help" | "help/" => format!("{}{}", HEADER, HELP),
"history" => history::as_raw_menu(), "history" => history::as_raw_menu(),
"bookmarks" => bookmarks::as_raw_menu(), "bookmarks" => bookmarks::as_raw_menu(),
@ -17,7 +17,7 @@ pub fn lookup(name: &str) -> Option<String> {
} }
pub const HEADER: &str = " pub const HEADER: &str = "
i /spacer i
i / / / i / / /
i ___ (___ ___ (___ ___ (___ i ___ (___ ___ (___ ___ (___
i| )| )|___)| | | ) i| )| )|___)| | | )
@ -26,8 +26,8 @@ i|
i i
"; ";
pub const HOME: &str = " pub const START: &str = "
i~ the quick lil gopher client ~ i ~ * ~
i i
7search gopher /v2/vs gopher.floodgap.com 7search gopher /v2/vs gopher.floodgap.com
1welcome to gopherspace /gopher gopher.floodgap.com 1welcome to gopherspace /gopher gopher.floodgap.com
@ -36,10 +36,10 @@ i
i i
i ~ * ~ i ~ * ~
i i
1show help \x1b[90mctrl-h /help phetch 1show help (ctrl-h) /help phetch
1show history \x1b[90mctrl-a /history phetch 1show history (ctrl-a) /history phetch
1show bookmarks \x1b[90mctrl-b /bookmarks phetch 1show bookmarks (ctrl-b) /bookmarks phetch
i\x1b[0m i
"; ";
pub const HELP: &str = " pub const HELP: &str = "
@ -61,76 +61,80 @@ i
pub const KEYS: &str = " pub const KEYS: &str = "
i ** keyboard shortcuts ** i ** keyboard shortcuts **
i i
i\x1b[95mleft \x1b[96mback in history ileft back in history
i\x1b[95mright \x1b[96mnext in history iright next in history
i\x1b[95mup \x1b[96mselect prev link iup select prev link
i\x1b[95mdown \x1b[96mselect next link idown select next link
i\x1b[95mpage up \x1b[96mscroll page up ipage up scroll page up
i\x1b[95mpage down \x1b[96mscroll page down ipage down scroll page down
i i
i\x1b[95mnum key \x1b[96mopen/select link inum key open/select link
i\x1b[95menter \x1b[96mopen current link ienter open current link
i\x1b[95mescape \x1b[96mcancel iescape cancel
i i
i\x1b[95mctrl-g \x1b[96mgo to gopher url ictrl-g go to gopher url
i\x1b[95mctrl-u \x1b[96mshow gopher url ictrl-u show gopher url
i\x1b[95mctrl-y \x1b[96mcopy url ictrl-y copy url
i\x1b[95mctrl-r \x1b[96mview raw source ictrl-r view raw source
i\x1b[95mctrl-w \x1b[96mtoggle wide mode ictrl-w toggle wide mode
i i
i\x1b[95mctrl-a \x1b[96mshow history ictrl-a show history
i\x1b[95mctrl-b \x1b[96mshow bookmarks ictrl-b show bookmarks
i\x1b[95mctrl-s \x1b[96msave bookmark ictrl-s save bookmark
i\x1b[0m i
"; ";
pub const NAV: &str = " pub const NAV: &str = "
i ** menu navigation ** i ** menu navigation **
i i
ithere are three ways to navigate ithere are three ways to
imenus in phetch: inavigate menus in phetch:
i i
1up & down arrows /help/nav phetch 1up & down arrows /help/nav phetch
i i
iuse the up and down arrows or the iuse the up and down arrows or
ictrl-p/ctrl-n combos to select menu ithe ctrl-p/ctrl-n combos to
iitems. phetch will scroll for you, iselect menu items. phetch will
ior you can use page up & page down iscroll for you, or you can use
i(or - and spacebar) to jump by many ipage up & page down (or - and
ilines quickly. ispacebar) to scroll by many
ilines at once.
i i
1number keys /help/nav phetch 1number keys /help/nav phetch
i i
iif there are few enough menu items, iif there are few enough menu
ipressing a number key will open the iitems, pressing a number key
iitem immediately. otherwise, it'll iwill open a link. otherwise,
ibe selected. use enter to open it. ithe first matching number will
ibe selected. use enter to open
ithe selected link.
i i
1incremental search /help/nav phetch 1incremental search /help/nav phetch
i i
ijust start typing. phetch will look ijust start typing. phetch will
ifor the first case insensitive match ilook for the first case-
iand try to select it. use the arrow iinsensitive match and try to
ior ctrl-p/n keys to cycle matches. iselect it. use arrow keys or
ictrl-p/n to cycle matches.
i i
"; ";
pub const BOOKMARKS: &str = " pub const BOOKMARKS: &str = "
i ** bookmarks ** i ** bookmarks **
i i
iphetch includes two ways to save iphetch has two ways to save
ithe current url: ithe url of the current page:
i
ictrl-y copy url
ictrl-s save bookmark
i i
i\x1b[95mctrl-y \x1b[96mcopy url iif ~/.config/phetch/ exists,
i\x1b[95mctrl-s \x1b[96msave bookmark ibookmarks will be saved to
i\x1b[0m
iif the ~/.config/phetch/ directory
iexists, bookmarks will be saved to
i~/.config/phetch/bookmarks.gph i~/.config/phetch/bookmarks.gph
i i
iuse ctrl-b to view them at any time. iuse ctrl-b to view them.
i i
ithe clipboard function uses: ithe clipboard function uses:
i i
i- `pbcopy` on macos i- `pbcopy` on macos
i- `xclip -sel clip` on linux i- `xclip -sel clip` on linux
@ -139,19 +143,20 @@ i";
pub const HISTORY: &str = " pub const HISTORY: &str = "
i ** history ** i ** history **
i i
iif you create a history.gph file iif you create a history.gph
iin ~/.config/phetch/, each url ifile in ~/.config/phetch/,
iyou visit will be store there. ieach gopher url you open will
ibe stored there.
i i
inew urls are appended to the inew urls are appended to the
ibottom, but loaded in reverse ibottom, but loaded in reverse
iorder so you'll see the most iorder, so you'll see the most
irecently visited pages first irecently visited pages first
iwhen you use ctrl-a. iwhen you use ctrl-a.
i i
ifeel free to edit your history ifeel free to edit your history
ifile directly, or share it with ifile directly, or share it
iyour friends! iwith your friends!
"; ";
pub const TYPES: &str = " pub const TYPES: &str = "

Loading…
Cancel
Save