mirror of https://github.com/Meekdai/Gmeek.git
add markmap.js
This commit is contained in:
parent
ac556c5cba
commit
02f15e8ec9
17
Gmeek.py
17
Gmeek.py
|
|
@ -180,6 +180,23 @@ class GMEEK():
|
||||||
if '<code class="notranslate">Gmeek-html' in post_body:
|
if '<code class="notranslate">Gmeek-html' in post_body:
|
||||||
post_body = re.sub(r'<code class="notranslate">Gmeek-html(.*?)</code>', lambda match: html.unescape(match.group(1)), post_body, flags=re.DOTALL)
|
post_body = re.sub(r'<code class="notranslate">Gmeek-html(.*?)</code>', lambda match: html.unescape(match.group(1)), post_body, flags=re.DOTALL)
|
||||||
|
|
||||||
|
if '<code class="notranslate">Markmap' in post_body:
|
||||||
|
markmap_template = '''
|
||||||
|
<style>
|
||||||
|
.markmap {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.markmap > svg {
|
||||||
|
width: 100%;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="markmap">
|
||||||
|
<script type="text/template">
|
||||||
|
'''
|
||||||
|
post_body = re.sub(r'<code class="notranslate">Markmap\s*([\s\S]*?)\s*<\/code>', \
|
||||||
|
lambda match: markmap_template + match.group(1) + '\n</script></div>', post_body, flags=re.DOTALL)
|
||||||
|
|
||||||
postBase["postTitle"]=issue["postTitle"]
|
postBase["postTitle"]=issue["postTitle"]
|
||||||
postBase["postUrl"]=self.blogBase["homeUrl"]+"/"+issue["postUrl"]
|
postBase["postUrl"]=self.blogBase["homeUrl"]+"/"+issue["postUrl"]
|
||||||
postBase["description"]=issue["description"]
|
postBase["description"]=issue["description"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue