From 0e64f9df7fe64856e9feea3a2d55bd801f0cc982 Mon Sep 17 00:00:00 2001
From: Niklas Fasching
Date: Mon, 17 Dec 2018 22:38:59 +0100
Subject: [PATCH] html: Render headline priority
---
README.org | 1 -
etc/style.css | 5 +++++
org/html.go | 4 ++++
org/testdata/headlines.html | 2 ++
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/README.org b/README.org
index bd57888..72f732d 100644
--- a/README.org
+++ b/README.org
@@ -8,7 +8,6 @@ Take a look at [[https://niklasfasching.github.io/go-org/][github pages]] for so
[[/images/org-mode-unicorn-logo.png]]
- more keywords: https://orgmode.org/manual/In_002dbuffer-settings.html
- headlines
- - export priority as default
- unique ids
- CUSTOM_ID drawer property
- see [[https://github.com/kaushalmodi/ox-hugo/blob/8472cf2d8667754c9da3728255634e8001a1da6d/ox-hugo.el#L1785-L1850][ox-hugo]] for auto generation
diff --git a/etc/style.css b/etc/style.css
index 9f51912..2dc15c2 100644
--- a/etc/style.css
+++ b/etc/style.css
@@ -113,3 +113,8 @@ figcaption {
dl { font-family: monospace, monospace; }
dl > dt { font-weight: bold; }
dl > dd { margin: -1em 0 1em 1em; }
+
+.todo, .priority, .tags {
+ font-size: 0.8em;
+ color: lightgrey;
+}
diff --git a/org/html.go b/org/html.go
index e34f5d0..7d03e9b 100644
--- a/org/html.go
+++ b/org/html.go
@@ -197,6 +197,10 @@ func (w *HTMLWriter) writeHeadline(h Headline) {
if h.Status != "" {
w.WriteString(fmt.Sprintf(`%s`, h.Status) + "\n")
}
+ if h.Priority != "" {
+ w.WriteString(fmt.Sprintf(`%s`, h.Priority) + "\n")
+ }
+
w.WriteString(title)
if len(h.Tags) != 0 {
tags := make([]string, len(h.Tags))
diff --git a/org/testdata/headlines.html b/org/testdata/headlines.html
index 36945d2..75bfff7 100644
--- a/org/testdata/headlines.html
+++ b/org/testdata/headlines.html
@@ -3,6 +3,7 @@ Simple Headline
TODO
+B
Headline with todo status & priority
@@ -13,6 +14,7 @@ Headline with TODO status
the content
+A
Headline with tags & priority foo bar