summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Frankel <rick@rickster.com>2013-04-15 13:59:16 -0400
committerRick Frankel <rick@rickster.com>2013-04-15 13:59:16 -0400
commitdb8d3f5dcfb4056c7920758c8c4fcd43654b27fb (patch)
tree30502eab792a5d27f92e8e1aadc995ad7b0c652a
parent6e1a39bd6efe8bf87d87ac42c8b86633d812791b (diff)
downloadorg-mode-db8d3f5dcfb4056c7920758c8c4fcd43654b27fb.tar.gz
Allow setting :HTML_CONTAINER as a per-headline property.
* lisp/ox-html.el (org-html-headline): Use (new) org-html--container function to set container element. (org-html--container): Returns appropriate element for headline container: 1. The element set on the headline :HTML_CONTAINER property. 2. the :html-container element (if the relative headline level is 1.) 3. The default ("div").
-rw-r--r--lisp/ox-html.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 84609b9..cfb83ab 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2200,9 +2200,7 @@ holding contextual information."
(level1 (+ level (1- org-html-toplevel-hlevel)))
(first-content (car (org-element-contents headline))))
(format "<%s id=\"%s\" class=\"%s\">%s%s</%s>\n"
- (if (= 1 (org-export-get-relative-level headline info))
- (plist-get info :html-container)
- "div")
+ (org-html--container headline info)
(format "outline-container-%s"
(or (org-element-property :CUSTOM_ID headline)
(concat "sec-" section-number)))
@@ -2227,9 +2225,13 @@ holding contextual information."
(concat (org-html-section first-content "" info)
contents)
contents)
- (if (= 1 (org-export-get-relative-level headline info))
- (plist-get info :html-container)
- "div")))))))
+ (org-html--container headline info)))))))
+
+(defun org-html--container (headline info)
+ (or (org-element-property :HTML_CONTAINER headline)
+ (if (= 1 (org-export-get-relative-level headline info))
+ (plist-get info :html-container)
+ "div")))
;;;; Horizontal Rule