@bograt i have never found one (save some papers from bell labs) which is not just explaining the default macros but how to write one yourself from scratch.
a okish looking macro can be written in some hundred lines, the hardest part is figuring out how the page traps work :)