From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: [PATCH] Add support for multile html container classes. Date: Thu, 29 Jul 2010 14:14:39 +0200 Message-ID: <1280405679-8762-1-git-send-email-dmaus@ictsoc.de> References: Return-path: Received: from [140.186.70.92] (port=51914 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeS0y-0007IO-QW for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 08:15:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeS0k-0003xd-T0 for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 08:14:55 -0400 Received: from mysql1.xlhost.de ([213.202.242.106]:40866) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeS0k-0003xD-OQ for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 08:14:54 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * 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
\n%s%s\n
\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