emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH] Add support for multile html container classes.


From: David Maus
Subject: [Orgmode] [PATCH] Add support for multile html container classes.
Date: Thu, 29 Jul 2010 14:14:39 +0200

* org-html.el (org-html-level-start): Add multiple container
classes.

* org-exp.el (org-export-remember-html-container-classes):
Parse multiple container classes.
---
 lisp/org-exp.el  |    7 ++++---
 lisp/org-html.el |   11 ++++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index f1cea62..d3da4da 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1311,11 +1311,12 @@ the current file."
   (goto-char (point-min))
   (let (class)
     (while (re-search-forward
-           "^[ \t]*:HTML_CONTAINER_CLASS:[ \t]+\\(\\S-+\\)" nil t)
-      (setq class (match-string 1))
+           "^[ \t]*:HTML_CONTAINER_CLASS:[ \t]+\\(.+\\)$" nil t)
+      (setq class (org-split-string (match-string 1) "[ \t]+"))
       (save-excursion
        (org-back-to-heading t)
-       (put-text-property (point-at-bol) (point-at-eol) 'html-container-class 
class)))))
+       (put-text-property
+        (point-at-bol) (point-at-eol) 'html-container-class class)))))
 
 (defvar org-export-format-drawer-function nil
   "Function to be called to format the contents of a drawer.
diff --git a/lisp/org-html.el b/lisp/org-html.el
index d972c58..28dd633 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -2177,9 +2177,12 @@ When TITLE is nil, just close all open levels."
   (let* ((target (and title (org-get-text-property-any 0 'target title)))
         (extra-targets (and target
                             (assoc target org-export-target-aliases)))
-        (extra-class (and title (org-get-text-property-any 0 
'html-container-class title)))
+        (extra-class
+         (and title
+              (org-get-text-property-any 0 'html-container-class title)))
         (preferred (and target
-                        (cdr (assoc target 
org-export-preferred-target-alist))))
+                        (cdr
+                         (assoc target org-export-preferred-target-alist))))
         (remove (or preferred target))
         (l org-level-max)
         snumber snu href suffix)
@@ -2244,7 +2247,9 @@ When TITLE is nil, just close all open levels."
        (setq suffix (or href snu))
        (setq href (or href (concat "sec-" snu)))
        (insert (format "\n<div id=\"outline-container-%s\" 
class=\"outline-%d%s\">\n<h%d id=\"%s\">%s%s</h%d>\n<div 
class=\"outline-text-%d\" id=\"text-%s\">\n"
-                       suffix level (if extra-class (concat " " extra-class) 
"")
+                       suffix level (if extra-class
+                                        (concat " "
+                                         (mapconcat 'identity extra-class " 
")))
                        level href
                        extra-targets
                        title level level suffix))
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]