Add support for list item checkboxes (e.g. [X])

see https://orgmode.org/manual/Checkboxes.html
We're deviating from Org mode regarding the assigned css classes but the chosen
classes feel better than (on, off, trans) and it's not like the export matches
1:1 otherwise.
This commit is contained in:
Niklas Fasching 2018-12-18 14:15:35 +01:00
parent a60f844e38
commit 7331d24452
7 changed files with 55 additions and 35 deletions

View file

@ -2,14 +2,14 @@
Simple Headline <code class="statistic">[1/2]</code>
</h1>
<ul>
<li>
<li class="checked">
<p>
[X] checked
checked
</p>
</li>
<li>
<li class="unchecked">
<p>
[ ] unchecked
unchecked
</p>
</li>
<li>

View file

@ -1,5 +1,5 @@
<ul>
<li>
<li class="unchecked">
<p>
unordered list item 1
</p>
@ -9,22 +9,22 @@ unordered list item 1
unordered list item 2 - with <code>inline</code> <em>markup</em>
</p>
<ol>
<li>
<li class="indeterminate">
<p>
ordered sublist item 1
</p>
<ol>
<li>
<li class="checked">
<p>
ordered sublist item 1
</p>
</li>
<li>
<li class="unchecked">
<p>
ordered sublist item 2
</p>
</li>
<li>
<li class="checked">
<p>
ordered sublist item 3
</p>
@ -38,7 +38,7 @@ ordered sublist item 2
</li>
</ol>
</li>
<li>
<li class="checked">
<p>
unordered list item 3 - and a <a href="https://example.com">link</a>
and some lines of text
@ -95,20 +95,20 @@ that spans multiple lines
descriptive lists
</p>
<dl>
<dt>
<dt class="unchecked">
term<dd>
<p>
details
continued details
</p>
<dd>
<dt>
<dt class="unchecked">
?<dd>
<p>
details without a term
</p>
<dd>
<dt>
<dt class="checked">
term<dd>
<p>
details on a new line

View file

@ -1,11 +1,11 @@
- unordered list item 1
- [ ] unordered list item 1
- unordered list item 2 - with ~inline~ /markup/
1. ordered sublist item 1
a) ordered sublist item 1
b) ordered sublist item 2
c) ordered sublist item 3
1. [-] ordered sublist item 1
a) [X] ordered sublist item 1
b) [ ] ordered sublist item 2
c) [X] ordered sublist item 3
2. ordered sublist item 2
- unordered list item 3 - and a [[https://example.com][link]]
- [X] unordered list item 3 - and a [[https://example.com][link]]
and some lines of text
1. and another subitem
#+BEGIN_SRC sh
@ -24,10 +24,10 @@
descriptive lists
- term :: details
- [ ] term :: details
continued details
- details without a term
- term ::
- [ ] details without a term
- [X] term ::
details on a new line
- term ::