docsy icon indicating copy to clipboard operation
docsy copied to clipboard

Markmap diagrams: various improvements

Open deining opened this issue 2 years ago • 3 comments

This PR brings various improvements for users of markmap mindmaps:

  • you now can set width and height individually for each mindmap (#1144)
  • autoactivation for mindmaps (on a per page basis), no need to enable markmap manually in hugo.yaml any more
  • Added integrity check when loading the markscript script files from CDN
  • Used markmap version can be be specified/pinned in configuration file (default version: latest)
  • markmap script was moved to assets/js/markmap.js (#1188, supersedes #1199)
  • markmap script does not use jquery any more
  • documentation was adapted to reflect the changes that come with this PR.

Scope:

  • Fixes #1144
  • Fixes #1188
  • Closes #1199 by superseding it. /cc @emckean

deining avatar Jan 24 '23 15:01 deining

Hello, Has anyone succeeded setting custom width and height for a markmap? and how?

The only way I found is to modify the scripts.html file:

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

But it is a global setting. It would be great if I can specify the width and height for a specific markmap. I've tried the following syntax but it doesn't work:

```markmap {height: 600}
...
```

Any suggestions?

huanlin avatar Jul 26 '24 01:07 huanlin

I just worked on this PR again:

  • resolved merge conflicts
  • dropped support for hugo versions < 0.93.0, to make the code base cleaner
  • Reflect adaptions in user guide ** dropped content on how to support hugo versions < 0.93.0 ** bumped markmap to latest version 0.17.0 (when version is manually pinned)

5 checkers are green, the failure of the remaining test is unrelated to the changes introduced with this PR.

This PR enables adjustment of width and height on a per diagram basis, which users ask for. Can anyone please review this PR so that we can get it merged soon? Thanks.

deining avatar Jul 26 '24 08:07 deining

Hello, Has anyone succeeded setting custom width and height for a markmap?

I was confronted with the same problem and authored this PR, which addresses and solves that issue.

and how?

This is documented in the preview of the userguide for this PR:

XXX CITATION XXX If needed, you can define the desired width and/or height of an individual mindmap via code block attributes:

```markmap { height="300px" width="700px" }
# ...
```

XXX END CITATION XXX

Any suggestions?

Kindly ask maintainers/community for review and eventual merge of this PR.

deining avatar Jul 26 '24 08:07 deining