Question
I’ve been recently discussing a collection of simple wikis containing full bible text. I have a handful available now. The idea is that users would build upon these wikis with their own tools. But I would like to supply a few extensions to both act as demos of how to create them, and to supply certain widely useful functionality that shouldn’t make it into the core.
I was wondering if there is any mechanism that these extensions can use to do some one-time initialization when they’re loaded. I haven’t seen anything, and I suspect not. But I’d like to hear a more definitive answer.
Example
For an example, one such extension would allow you to navigate via sections of the bible (Old/New Testament, Major Prophets, Gospels, etc. You can load any of these English-language wikis:
then download this, and drag the resulting file onto the wiki:
sections.json (3.4 KB)
There will now be a new entry in the sidebar TOC called “Sections”. That will expand to show these groups. But the books are not yet tagged as such. There is a button in $:/_/bible/sections/scripts/update-books
that will add tags to every book with this information. This needs only be run once.
(This won’t work for the one Spanish wiki, Reina Valera Gómez, as it still needs internationalization.)
Recap
My question is whether there’s any way to automate this? Can an extension (now a JSON bundle, probably eventually a plugin) do this when its installed?