Ik heb een bookmarklet gemaakt om de inhoudsopgave voor forum posts te maken

This can be done using a theme component. You can take a look at the decorateCookedElement method of the api, it should be useful.