Skip to content

36 comments

This is a very nice project, just a one issue. I know npm install is very convenient and nice but I'm wary of installing anything that my package manager doesn't know about(through npm, pip, make install, etc.)

Could you make a PKGBUILD and upload the package on AUR. You can still use npm install, for example check this package

26 points

Makes sense, I'll do this later tonight or tomorrow and will reply to this thread to let you know.

11 points

So I'm learning node and wrote this to get better with promises and because I didn't like the existing solutions much for command-line arch wiki browsing.

First you need Node. Then install this with npm install -g arch-wiki-man, which will also save a local copy of all the wiki articles in markdown on your drive (it gets updated with changes to the wiki every two days, run the install command again in the future to fetch those updates).

Once installed, do an awman -h for usage details. Options are search in descriptions with -d, apropos-style in-content search with -k and open articles in your browser rather than man with -w.

I'm not sure if this is just useful for me or for others too but here it is :) If you do like it, drop me a star on github :)

edit-- Woo, thanks for the gold!!

edit2-- It's now also available on the AUR

15 points

So you know of arch-wiki-markdown-git? I've been using the updated branch for a while, which supports live-generation from the wiki and generating from arch-wiki-docs. What are the advantages of your solution over that package?

3 points

Oh wow, I hadn't seen this before but I have seen arch-wiki-docs as there are links to it in the wiki. For some reason I never got it working on my machine though, maybe due to an issue with python 2/3 on my end. And I can't seem to install arch-wiki-markdown-git either as I get dependency conflicts with vim and my neovim setup is too precious for me right now to risk screwing up! I definitely will take a better look at it later though. Based on a cursory glance at it, those repos you linked look better and more robust when it comes to the generation of the wiki so when I find some time, I will address my issues and get it to work - and maybe borrow some ideas.

As for advantages of my approach, looking at the readme, it doesn't sound like there is a selection menu, which mine does have. I also allow for searching for a matching article in the descriptions (which is usually the first paragraph of the article) with -d and and in the contents of every article with -k. And of course it converts the selected article on the fly to roff and displays it in man. Oh, and you can also open the articles in your web browser instead of man with -w.

So yeah, in short I think the wiki generation is better in the ones you linked, but maybe my command-line interface is a little nicer?

2 points

This is great! I'm going to give this a try once I get home.

2 points

If we can get enough votes, I could easily see this getting into community.

2 points

Hey, this is pretty spiffy. Is it easy to adapt to other wikis? Like wikipedia or wikihow?

As is, this is pretty fantastic, but a generic, caching wiki* reader sounds even better. :-D

7 points

The underlying scraper I wrote before Christmas to get the articles off the Arch Wiki is also on github here.

Right now it's hardcoded for the Arch Wiki, but as long as a wiki has a TOC and a last changes page, it shouldn't be too difficult to modify the code so it scrapes a different wiki. However I'm pretty sure scraping a much bigger one with this wouldn't end well, the code would have to be optimized first because right now it's keeping everything in memory as it steps through chains of promise arrays. I might do some more refactoring later on but feel free to fork and give it a shot (beware of shoddy code in this older repo though! :)

9 points

So, what's the difference between this and arch-wiki-lite, which is already in the community repo (not AUR)?

3 points

I had no idea that existed. People keep pointing me to stuff that I totally missed! :)

Anyway, that's pretty nifty. The difference is the wiki generation that solution uses is better (until I update mine that is), but my command-line interface is probably nicer. When you have multiple matches, you get a little menu to choose an article from with arrow keys or vim keybindings and it opens the result in straight man (or in your web browser if you prefer). You can also search for matches just in titles, in descriptions or in the entire article contents. Oh and in mine, the matches are ordered by last update, which I think works well as a proxy of importance of the article.

2 points

What's offline about it? Does it scrape/mirror the entire arch wiki locally?

1 points

Yes, it depends on my arch-wiki-md-repo which holds a local copy of all the articles in markdown and a little json database to search in. So install it once and it runs offline (well obviously the open in browser option won't work without Internet)

1 points

arch-wiki-md-repo looks cool. With some link reworking magic it could be used with mdwiki and would provide totally offline wiki in the browser.

1 points

Dude, this is fucking genius. I've always wanted something like this without fully realizing it could be made. This is gonna be one of my default installed packages from now on. Thanks a lot!

1 points

Haha glad you like it! I'll be pushing an update next week or so which among other things should fix some of the formatting issues so don't forget to update later on :)

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.