-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from neatc0der/feature/encryptcontent
feature/encryptcontent
- Loading branch information
Showing
3 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# v2.2.0 | ||
|
||
* Fixes distribute workflow | ||
* Adds [support for mkdocs-encryptcontent-plugin](https://github.com/neatc0der/mkdocs-markmap/issues/26) | ||
* Adds troubleshooting for [nav tree lists markmap files](https://github.com/neatc0der/mkdocs-markmap/issues/33) | ||
* Fixes distribute workflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,33 @@ | ||
(function initializeMarkmap() { | ||
const markmap_transformer = new markmap.Transformer(); | ||
const markmaps = document.getElementsByClassName('mkdocs-markmap'); | ||
var el, content, svg, root, m; | ||
for (var i = 0; i < markmaps.length; i++) { | ||
el = markmaps[i]; | ||
content = el.getAttribute('data-markdown').replaceAll(' ', '\n'); | ||
svg = el.querySelector('svg'); | ||
root = markmap_transformer.transform(content).root; | ||
m = markmap.Markmap.create(svg, null, root); | ||
function update_markmaps() { | ||
const markmap_transformer = new markmap.Transformer(); | ||
const markmaps = document.getElementsByClassName('mkdocs-markmap'); | ||
var el, content, svg, root, m; | ||
for (var i = 0; i < markmaps.length; i++) { | ||
el = markmaps[i]; | ||
content = el.getAttribute('data-markdown').replaceAll(' ', '\n'); | ||
svg = el.querySelector('svg'); | ||
root = markmap_transformer.transform(content).root; | ||
m = markmap.Markmap.create(svg, null, root); | ||
|
||
(function(obj, e, r) { | ||
obj.rescale(1).then(function() { | ||
e.parentElement.style.height = (e.getBBox().height + 10) + "px"; | ||
requestAnimationFrame(() => { obj.fit(); }) | ||
}); | ||
})(m, svg, root); | ||
(function(obj, e, r) { | ||
obj.rescale(1).then(function() { | ||
e.parentElement.style.height = (e.getBBox().height + 10) + "px"; | ||
requestAnimationFrame(() => { obj.fit(); }) | ||
}); | ||
})(m, svg, root); | ||
} | ||
} | ||
|
||
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; | ||
var observer = new MutationObserver(function(mutations) { | ||
update_markmaps(); | ||
}); | ||
|
||
var target = document.getElementById('mkdocs-decrypted-content'); | ||
if (undefined != target) { | ||
observer.observe(target, { childList: true }); | ||
} | ||
|
||
update_markmaps(); | ||
})(); |