From: "Zane D. Purvis" <zane.purvis@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] ox-html.el: Add exporting of priority
Date: Fri, 9 Jan 2015 10:43:22 -0500 [thread overview]
Message-ID: <CAGJcBOcS1zZfBvKrf0Hw1U+XHeTnuU2u3zcAD10dZF0NZHQa+A@mail.gmail.com> (raw)
* list/ox-html.el (org-html--priority): New function.
(org-html-format-headline-default-function): Call `org-html--priority'.
(org-html-style-default): Add `.priority'.
HTML export previously did not support exporting of priority simply by setting
`org-export-with-priority' to `t'.
TINYCHANGE
---
lisp/ox-html.el | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 3c3b444..a1c33ac 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -278,6 +278,7 @@ defconst org-html-style-default
.done { color: green; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
+ .priority { font-family: monospace; color: orange; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right { margin-left: auto; margin-right: 0px; text-align: right; }
@@ -1885,6 +1886,14 @@ defun org-html--todo (todo info)
(org-html-fix-class-name todo)
todo)))
+;;;; Priority
+
+(defun org-html--priority (priority info)
+ "Format a priority into HTML.
+PRIORITY is the character code of the priority or nil.
+INFO is a plist containing export options."
+ (and priority (format "<span class=\"priority\">[%c]</span>" priority)))
+
;;;; Tags
(defun org-html--tags (tags info)
@@ -2396,8 +2405,9 @@ defun org-html-format-headline-default-function
"Default format function for a headline.
See `org-html-format-headline-function' for details."
(let ((todo (org-html--todo todo info))
+ (priority (org-html--priority priority info))
(tags (org-html--tags tags info)))
- (concat todo (and todo " ") text (and tags "   ") tags)))
+ (concat todo (and todo " ") priority (and priority " ") text (and
tags "   ") tags)))
(defun org-html--container (headline info)
(or (org-element-property :HTML_CONTAINER headline)
--
1.9.2.msysgit.0
next reply other threads:[~2015-01-09 15:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-09 15:43 Zane D. Purvis [this message]
2015-01-10 9:29 ` [PATCH] ox-html.el: Add exporting of priority Nicolas Goaziou
-- strict thread matches above, loose matches on Subject: below --
2015-01-09 3:23 [PATCH] ox-html.el: add " Zane D. Purvis
2015-01-09 8:20 ` Nicolas Goaziou
2015-01-09 14:30 ` Zane D. Purvis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGJcBOcS1zZfBvKrf0Hw1U+XHeTnuU2u3zcAD10dZF0NZHQa+A@mail.gmail.com \
--to=zane.purvis@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.