85 lines
4.2 KiB
HTML
85 lines
4.2 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Zk | Vimwiki Markdown Extension</title>
|
|
<link rel="stylesheet" type="text/css" href="/style.css" />
|
|
<meta name="viewport" content="width=device-width" />
|
|
<meta charset="utf-8" />
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<header>
|
|
<h1>Zk | Vimwiki Markdown Extension</h1>
|
|
</header>
|
|
<article class="content">
|
|
<p><span class="tag">tech</span> <span class="tag">markdown</span> <span class="tag">vimwiki</span> <span class="tag">python</span> <span class="tag">package</span></p>
|
|
<h2 id="what-it-does">What it does</h2>
|
|
<p>I like markdown better than vimiwki's wiki syntax, especially since I run so many sites that use markdown for pages. Unfortunately, I like a few attributes of vimiwki's syntax, such as the to-do lists and the tags.</p>
|
|
<p>This extension brings in that functionality as a Python Markdown extension.</p>
|
|
<ul>
|
|
<li class="rejected"> Rejected</li>
|
|
<li class="done0"> 0%</li>
|
|
<li class="done1"> 1-33%</li>
|
|
<li class="done2"> 34-66%</li>
|
|
<li class="done3"> 67-99%</li>
|
|
<li class="done4"> 100%</li>
|
|
</ul>
|
|
<h2 id="how-to-use-it">How to use it</h2>
|
|
<div class="codehilite"><pre><span></span><code><span class="n">default_config</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s1">'list_levels'</span><span class="p">:</span> <span class="s1">'- .oOX'</span><span class="p">,</span>
|
|
<span class="s1">'list_classes'</span><span class="p">:</span> <span class="p">[</span><span class="s1">'rejected'</span><span class="p">,</span> <span class="s1">'done0'</span><span class="p">,</span> <span class="s1">'done1'</span><span class="p">,</span> <span class="s1">'done2'</span><span class="p">,</span> <span class="s1">'done3'</span><span class="p">,</span> <span class="s1">'done4'</span><span class="p">],</span>
|
|
<span class="p">}</span>
|
|
<span class="n">my_config</span> <span class="o">=</span> <span class="p">{</span>
|
|
<span class="s1">'list_levels'</span><span class="p">:</span> <span class="s1">'iao'</span><span class="p">,</span>
|
|
<span class="s1">'list_classes'</span><span class="p">:</span> <span class="p">[</span><span class="s1">'yip'</span><span class="p">,</span> <span class="s1">'yap'</span><span class="p">,</span> <span class="s1">'yop'</span><span class="p">],</span>
|
|
<span class="p">}</span>
|
|
<span class="n">markdown</span><span class="p">(</span><span class="n">source</span><span class="p">,</span> <span class="n">extensions</span><span class="o">=</span><span class="p">[</span><span class="n">VimwikiExtension</span><span class="p">(</span><span class="o">**</span><span class="n">my_config</span><span class="p">)])</span>
|
|
</code></pre></div>
|
|
|
|
|
|
<h2 id="where-to-get-it">Where to get it</h2>
|
|
<ul>
|
|
<li><a href="https://pypi.com/project/markdown-vimwiki">PyPI</a></li>
|
|
<li><a href="https://github.com/makyo/markdown-vimiwki">Github</a></li>
|
|
</ul>
|
|
<span class="control">Expand all</span>
|
|
</article>
|
|
<footer>
|
|
<p>Page generated on 2020-04-21</p>
|
|
</footer>
|
|
</main>
|
|
<script type="text/javascript">
|
|
document.querySelectorAll('li').forEach(el => {
|
|
if (el.querySelectorAll('li').length !== 0) {
|
|
el.classList.add('has-nested', 'closed');
|
|
el.innerHTML = `<span class="toggle"></span> ${el.innerHTML}`;
|
|
}
|
|
});
|
|
document.querySelectorAll('.toc .has-nested').forEach(el => {
|
|
el.classList.remove('has-nested', 'closed');
|
|
});
|
|
document.querySelectorAll('li.has-nested').forEach(el => {
|
|
el.querySelector('.toggle').addEventListener('click', () => {
|
|
el.classList.toggle('closed');
|
|
});
|
|
});
|
|
let expanded = false;
|
|
document.querySelector('.control').addEventListener('click', (e) => {
|
|
expanded = !expanded;
|
|
if (expanded) {
|
|
e.target.innerText = 'Collapse all';
|
|
} else {
|
|
e.target.innerText = 'Expand all';
|
|
}
|
|
document.querySelectorAll('.has-nested').forEach((el) => {
|
|
if (expanded) {
|
|
el.classList.remove('closed');
|
|
} else {
|
|
el.classList.add('closed')
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|