Today while updating the “About” page, I somehow got the idea to display a random “-ism” on the main page. Something like an “-ism” of the day, only bound to one iteration of this website. As the pages are built on-demand by asciidoc and a Makefile, one iteration is essentially one version of this whole website (or rather the index page, where the “-ism” is being displayed). Every time I make a change to that page (like when updating the “Recent additions” list), a new “-ism” will be displayed.

This is accomplished through a system macro in the asciidoc code:

index.txt
* This iteration's featured _-ism_:
{sys3:shuf -n1 isms}

The isms file contains a list of links to the respective “-ism” page on Wikipedia. Because Wikipedia itself has no complete list of “-isms”, I had to find some good lists myself.

But how does one get from HTML output to a nice list of URLs? Well, I could have used some parser, but that’s just too complicated. One can do this with good old vim:

ism.vim
1
2
3
/\v.*\<a href\="([^"]+)"[^>]+\>([^<]+ism)\<\/a\>.*
:v//d
:%s//<a href="https:\/\/en.wikipedia.org\1">\2<\/a>/g

The first line searches for a link to an “-ism”, the second one deletes all lines that do not match this search, and the third one finally replaces the match with a simple link to Wikipedia. This is needed because Wikipedia uses relative links like href="wiki/Marxism". It also removes all other attributes and properties from the <a> tag.

After “parsing” several pages like this (and running sort -fu), I ended up with an isms file that has ~1000 lines. Click here for the complete list. Suggestions and fixes welcome.