Re:Show HN: Terminal Based Wikipedia
by capitainenemo on Sunday March 12, 2023 @01:54PM
(#35123566)
Oh, BTW, this sort of thing works well with any sort of site that degrades gracefully/is not pure JS.
$ alias crate='f(){ w3m -F "https://lib.rs/search?q=${1}"; unset -f f; }; f'
$ crate rocket
(lib.rs is a crate index using rust as the server instead of javascript, and has advantage of working well with terminal browsers)
Re:Show HN: Terminal Based Wikipedia
by SoftTalker on Sunday March 12, 2023 @02:33PM
(#35124197)
This is the Unix way. You already have the tools and utilities you need, just pipeline them together and make an alias if it’s something you need frequently.
hey, off topic but can you explain or link a post which explains what the benefits of the alias -> function definition are over just defining the function directly?
Thanks!
Re:Show HN: Terminal Based Wikipedia
by prmoustache on Sunday March 12, 2023 @06:58PM
(#35127639)
I am puzzled as well, why not define the function and call it wiki?
Re:Show HN: Terminal Based Wikipedia
by capitainenemo on Sunday March 12, 2023 @07:30PM
(#35128114)
I'm just used to keeping all my aliases together for easy location with alias command and I like having ones with arguments with the others.
Aside from that, no benefit really that I can think of.
A tab to the wikipedia search page bookmarked would work well too and could be used in existing w3m/lynx session.