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...)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue