Module markmap-autoloader

markmap-autoloader

NPM License Downloads

Load markmaps automatically in HTML.

HTML:

<style>
.markmap {
position: relative;
}
.markmap > svg {
width: 100%;
height: 300px;
}
</style>

<div class="markmap">
<script type="text/template">
- markmap
- autoloader
- transformer
- view
</script>
</div>

Note that <script type="text/template"> is optional, for the content inside to be invisible before the markmap is rendered.

Autoload all elements matching .markmap, using latest autoloader version:

<script src="https://cdn.jsdelivr.net/npm/markmap-autoloader@latest"></script>

To use specific version (here: 0.14.3) of mark-autoloader:

<script src="https://cdn.jsdelivr.net/npm/markmap-autoloader@0.14.3"></script>

Load manually:

<script>
window.markmap = {
autoLoader: { manual: true },
};
</script>
<script src="https://cdn.jsdelivr.net/npm/markmap-autoloader"></script>
<script>
// Render in 5s
setTimeout(() => {
markmap.autoLoader.renderAll();
}, 5000);
</script>

Disable built-in plugins:

<script>
window.markmap = {
autoLoader: {
transformPlugins: [],
},
};
</script>
<script src="https://cdn.jsdelivr.net/npm/markmap-autoloader"></script>

Interfaces

AutoLoaderOptions

Variables

ready

Functions

render
renderAll
renderAllUnder