Is there an event I can listen to on each page to init some small js i wrote? Now its initializing before the dom is parsed.
I'm walking around the same issue, encaspulate the code into something like:
window.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
microlink('.demo-link', {
rounded: true
})
}, 200)
})
It's too tricky. Ideally, docsify could emit an event when the page is mounted:
window.addEventListener('docsify:ready', () => {
microlink('.demo-link', {
rounded: true
})
})
This can be accomplished using docsify's plugin architecture:
// Plugin
function doSomething(hook, vm) {
hook.doneEach(function() {
// Do something...
});
}
// Add to plugin array
$docsify.plugins = [].concat(doSomething, $docsify.plugins);
Most helpful comment
This can be accomplished using docsify's plugin architecture: