html: Export headline todo status & tags
This commit is contained in:
parent
6887fb2e02
commit
24ace5aa0e
4 changed files with 98 additions and 25 deletions
15
org/html.go
15
org/html.go
|
@ -173,9 +173,20 @@ func (w *HTMLWriter) writeFootnotes(d *Document) {
|
|||
}
|
||||
|
||||
func (w *HTMLWriter) writeHeadline(h Headline) {
|
||||
w.WriteString(fmt.Sprintf("<h%d>", h.Lvl))
|
||||
w.WriteString(fmt.Sprintf("<h%d>\n", h.Lvl))
|
||||
if h.Status != "" {
|
||||
w.WriteString(fmt.Sprintf(`<span class="todo">%s</span>`, h.Status) + "\n")
|
||||
}
|
||||
w.writeNodes(h.Title...)
|
||||
w.WriteString(fmt.Sprintf("</h%d>\n", h.Lvl))
|
||||
if len(h.Tags) != 0 {
|
||||
tags := make([]string, len(h.Tags))
|
||||
for i, tag := range h.Tags {
|
||||
tags[i] = fmt.Sprintf(`<span>%s</span>`, tag)
|
||||
}
|
||||
w.WriteString("   ")
|
||||
w.WriteString(fmt.Sprintf(`<span class="tags">%s</span>`, strings.Join(tags, " ")))
|
||||
}
|
||||
w.WriteString(fmt.Sprintf("\n</h%d>\n", h.Lvl))
|
||||
w.writeNodes(h.Children...)
|
||||
}
|
||||
|
||||
|
|
4
org/testdata/footnotes.html
vendored
4
org/testdata/footnotes.html
vendored
|
@ -1,4 +1,6 @@
|
|||
<h1>Using some footnotes</h1>
|
||||
<h1>
|
||||
Using some footnotes
|
||||
</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<p>
|
||||
|
|
18
org/testdata/headlines.html
vendored
18
org/testdata/headlines.html
vendored
|
@ -1,4 +1,14 @@
|
|||
<h1>Simple Headline</h1>
|
||||
<h1>Headline with todo status & priority</h1>
|
||||
<h1>Headline with TODO status</h1>
|
||||
<h1>Headline with tags & priority</h1>
|
||||
<h1>
|
||||
Simple Headline
|
||||
</h1>
|
||||
<h1>
|
||||
<span class="todo">TODO</span>
|
||||
Headline with todo status & priority
|
||||
</h1>
|
||||
<h1>
|
||||
<span class="todo">DONE</span>
|
||||
Headline with TODO status
|
||||
</h1>
|
||||
<h1>
|
||||
Headline with tags & priority   <span class="tags"><span>foo</span> <span>bar</span></span>
|
||||
</h1>
|
||||
|
|
86
org/testdata/misc.html
vendored
86
org/testdata/misc.html
vendored
|
@ -1,7 +1,15 @@
|
|||
<h2>issues from goorgeous (free test cases, yay!)</h2>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/19">#19</a>: Support #+HTML</h3>
|
||||
<h2>
|
||||
issues from goorgeous (free test cases, yay!)
|
||||
</h2>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/19">#19</a>: Support #+HTML
|
||||
</h3>
|
||||
<p style="border: 1px dotted grey">neato!</p>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/29">#29:</a> Support verse block</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/29">#29:</a> Support verse block
|
||||
</h3>
|
||||
<div class="verse-block">
|
||||
<p>
|
||||
This
|
||||
|
@ -15,7 +23,10 @@ or even a <strong>totally</strong> <em>custom</em> kind of block
|
|||
crazy ain't it?
|
||||
</p>
|
||||
</div>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/31">#31</a>: Support #+INCLUDE</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/31">#31</a>: Support #+INCLUDE
|
||||
</h3>
|
||||
<p>
|
||||
Note that only src/example/export block inclusion is supported for now.
|
||||
There's quite a lot more to include (see the <a href="https://orgmode.org/manual/Include-files.html">org manual for include files</a>) but I
|
||||
|
@ -84,7 +95,10 @@ deploy:
|
|||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/33">#33</a>: Wrong output when mixing html with org-mode</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/33">#33</a>: Wrong output when mixing html with org-mode
|
||||
</h3>
|
||||
<div class="outline-2" id="meta" style="color: green;">
|
||||
<table>
|
||||
<tbody>
|
||||
|
@ -99,7 +113,10 @@ deploy:
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/46">#46</a>: Support for symbols like ndash and mdash</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/46">#46</a>: Support for symbols like ndash and mdash
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<p>
|
||||
|
@ -127,13 +144,19 @@ note that —— is replaced with 2 mdashes and …. becomes ellipsis+. and so o
|
|||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/47">#47:</a> Consecutive <code>code</code> wrapped text gets joined</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/47">#47:</a> Consecutive <code>code</code> wrapped text gets joined
|
||||
</h3>
|
||||
<p>
|
||||
either <code>this</code> or <code>that</code> foo.
|
||||
either <code>this</code>
|
||||
or <code>that</code> foo.
|
||||
</p>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/50">#50</a>: LineBreaks in lists are preserved</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/50">#50</a>: LineBreaks in lists are preserved
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<p>
|
||||
|
@ -165,15 +188,24 @@ foo
|
|||
</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/68">#68</a>: Quote block with inline markup</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/68">#68</a>: Quote block with inline markup
|
||||
</h3>
|
||||
<blockquote>
|
||||
<p>
|
||||
<a href="https://www.example.com"><em>this</em> <strong>is</strong> <span style="text-decoration: underline;">markup</span>!</a>
|
||||
</p>
|
||||
</blockquote>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/72">#72</a>: Support for #+ATTR_HTML</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/72">#72</a>: Support for #+ATTR_HTML
|
||||
</h3>
|
||||
<img src="https://golang.org/doc/gopher/pkg.png" alt="Go is fine though." title="https://golang.org/doc/gopher/pkg.png" width="300" style="border:2px solid black;"/>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/75">#75</a>: Not parsing nested lists correctly</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/75">#75</a>: Not parsing nested lists correctly
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<p>
|
||||
|
@ -188,8 +220,14 @@ sub bullet
|
|||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/77">#77</a>: Recognize <code class="verbatim">code</code>— as code plus dash</h3>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/78">#78</a>: Emphasis at beginning of line</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/77">#77</a>: Recognize <code class="verbatim">code</code>— as code plus dash
|
||||
</h3>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/78">#78</a>: Emphasis at beginning of line
|
||||
</h3>
|
||||
<p>
|
||||
<em>italics</em>
|
||||
</p>
|
||||
|
@ -197,17 +235,29 @@ sub bullet
|
|||
Text
|
||||
<em>italics</em>
|
||||
</p>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/82">#82</a>: Crash on empty headline</h3>
|
||||
<h4></h4>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/82">#82</a>: Crash on empty headline
|
||||
</h3>
|
||||
<h4>
|
||||
|
||||
</h4>
|
||||
<p>
|
||||
just a space as title…
|
||||
</p>
|
||||
<h3><a href="https://github.com/chaseadamsio/goorgeous/issues/84">#84</a>: Paragraphs that are not followed by an empty line are not parsed correctly</h3>
|
||||
<h4>Foo</h4>
|
||||
<h3>
|
||||
<span class="todo">DONE</span>
|
||||
<a href="https://github.com/chaseadamsio/goorgeous/issues/84">#84</a>: Paragraphs that are not followed by an empty line are not parsed correctly
|
||||
</h3>
|
||||
<h4>
|
||||
Foo
|
||||
</h4>
|
||||
<p>
|
||||
Foo paragraph.
|
||||
</p>
|
||||
<h4>Bar</h4>
|
||||
<h4>
|
||||
Bar
|
||||
</h4>
|
||||
<p>
|
||||
Bar paragraph
|
||||
</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue