raannakasturi commited on
Commit
9c9ffb4
·
1 Parent(s): 4c413f1

Add Markmap toolbar integration and auto-fit functionality in post_blog.py

Browse files
Files changed (1) hide show
  1. post_blog.py +13 -0
post_blog.py CHANGED
@@ -23,6 +23,19 @@ def generate_post_html(title, summary, mindmap, citation):
23
  html_summary = mistune.html(summary)
24
  post = f"""
25
  <div id="paper_post">
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  <script src="https://cdn.jsdelivr.net/npm/markmap-autoloader@latest"></script>
27
  <style>
28
  .markmap {{
 
23
  html_summary = mistune.html(summary)
24
  post = f"""
25
  <div id="paper_post">
26
+ <script src='https://cdn.jsdelivr.net/npm/markmap-toolbar@0.18.4/dist/index.min.js'/>
27
+ <script async='async' src='https://cdn.jsdelivr.net/npm/markmap-autoloader@latest'/>
28
+ <script>
29
+ window.addEventListener(&#39;load&#39;, function() {{
30
+ const element = document.querySelector(&#39;div.mm-toolbar-item[title=&quot;Fit window size&quot;]&#39;);
31
+ if (element) {{
32
+ element.click();
33
+ }} else {{
34
+ console.log(&#39;Element not found&#39;);
35
+ }}
36
+ }}, 500); // Adjust the delay if needed
37
+ }});
38
+ </script>
39
  <script src="https://cdn.jsdelivr.net/npm/markmap-autoloader@latest"></script>
40
  <style>
41
  .markmap {{