95 lines
5.4 KiB
HTML
95 lines
5.4 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Zk | Editing 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 | Editing 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 want to be able to have editing comments in Markdown, so I came up with some extensions to the syntax. The goal should be for the text to still be at least mostly readable.</p>
|
|
<ul>
|
|
<li class="done4"> Additions <code><ins class="addition">new text</ins></code></li>
|
|
<li class="done4"> Deletions <code><del class="deletion">old text</del></code></li>
|
|
<li class="done4"> Substitutions <code><span class="substitution"><del>old</del><ins>new</ins></span></code></li>
|
|
<li class="done4"> Comments <code><mark class="selected">la de da<aside>comment</aside></mark></code></li>
|
|
<li class="done4"> Resolutions <code><aside class="comment">-{bad wolf</aside>}(STET)</code></li>
|
|
<li>Metadata:<ul>
|
|
<li class="done4"> Comments on all types in parentheses after <code><span class="substitution"><del>old</del><ins>new</ins><aside>comment</aside></span></code> etc</li>
|
|
<li class="done4"> Attribution in parentheses in comment <code><ins class="addition">new<aside>comment<span class="attribution">Commenter</span></aside></ins></code></li>
|
|
<li class="done4"> Date with attribution <code><del class="deletion">old<aside>comment<span class="attribution">Commenter</span><span class="date">2020-04-21</span></aside></del></code></li>
|
|
<li class="done0"> Comment as footnote <code><mark class="selected">la de da<aside>^note</aside></mark> ... (^note): comment</code></li>
|
|
<li class="done0"> Comments can contain markup <code><mark class="selected">la de da<aside>some *markup*</aside></mark></code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<p>This is a <ins class="addition">new</ins> addition</p>
|
|
<p>This <del class="deletion">this</del> word is removed</p>
|
|
<p>I say, <span class="substitution"><del>out with the old</del><ins>in with the new</ins></span></p>
|
|
<p>Here <aside class="comment">just a comment</aside> is a line with a comment</p>
|
|
<p>You can also <mark class="selected">add comments to some text<aside>Like this</aside></mark></p>
|
|
<p>All <del class="deletion">new<aside>Redundant<span class="attribution">Makyo</span></aside></del> edit marks can have comments with attributions and dates <ins class="addition">like this<aside>See?<span class="attribution">Makyo</span><span class="date">2020-04-22</span></aside></ins> (though it's ignored with comments <aside class="comment">like this</aside>)</p>
|
|
<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">'tag_tuple'</span><span class="p">:</span> <span class="p">(</span><span class="s1">'<div class="verse">'</span><span class="p">,</span> <span class="s1">'</div>'</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">'tag_tuple'</span><span class="p">:</span> <span class="p">(</span><span class="s1">'<verse>'</span><span class="p">,</span> <span class="s1">'</verse>'</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">VerseExtension</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-verse">PyPI</a></li>
|
|
<li><a href="https://github.com/makyo/markdown-verse">Github</a></li>
|
|
</ul>
|
|
<span class="control">Expand all</span>
|
|
</article>
|
|
<footer>
|
|
<p>Page generated on 2020-04-22</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>
|