'Looking for an example for using markmap in HTML file with Markdown

I want to use markmap with a static site generator. Therefore I want to find an example where markmap is used from HTML. I.e., the HTML file should contain the Markdown statements to produce the desired mindmap. The idea is that the actual mindmap is produced during presentation time (=end user fetching the HTML), not during site generation time.

Unfortunately, the documentation page of markmap does not provide such an example.

Many thanks in advance.



Solution 1:[1]

I asked the author of markmap, Gerald Liu. He prompty suggests to look at markmap-autoloader. Thanks Gerald!

The example is thus:

<html>
<body>

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

<div class="markmap">
# markmap
## autoloader
## transformer
## view
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/markmap-autoloader"></script>
</html>

Above code will produce below mindmap: markmap generated Mindmap

This is what I now use in the static site generator Simplified Saaze.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Elmar Klausmeier