Hi user-script coding gurus,
I’ve been working on a user script to add an extra section to the vocabulary reading explanation (related to rendaku). The plan is for the extra section to appear on the vocab, lesson and reviews pages (for reviews, specifically when showing the reading explanation). I looked through some existing scripts to see how to do this, and from that I’ve put something together which is mostly working.
It occurs to me that part of this is a very generic task - i.e. to add some section to the reading or meaning info for an item, and have that appear in all the relevant places, formatted as another subsection at the same level as e.g. “Reading Notes” or “Reading Explanation“, etc. An existing example would be the phonetic-semantic composition script.
If the generic part of this exists, then I would then just have to provide a function which gives my custom section info (title and contents - actually a list of these since there might be none or more than one extra sections). The function would receive the item name, type (radical, kanji or vocab) and context (meaning or reading) and return the list of custom info sections.
Does a generic wrapper of this kind exist already? If not, has one of the experts here considered writing such a thing? I’m working on my own version, but I’m new to tampermonkey and the internals of the wanikani pages, so it is a bit of a hack to figure out where/when for the script to modify the pages. I’m sure that someone with more experience will do a better job than me (and that perhaps it is not too hard a job). It would be nice if this generic component was part of a “maintained” support scripts package so that it could be kept up to date with any changes in the internals of the wanikani page formatting.
Any help/input appreciated… Thanks!