From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: [PATCH] Make html exporter respect css-url configuration variable. Date: Tue, 19 Feb 2013 19:06:49 -0500 Message-ID: <20130220000649.GA9295@BigDog.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7xD4-000200-Iz for emacs-orgmode@gnu.org; Tue, 19 Feb 2013 19:06:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7xD1-0005TS-Vw for emacs-orgmode@gnu.org; Tue, 19 Feb 2013 19:06:54 -0500 Received: from [204.62.15.78] (port=48568 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7xD1-0005SL-Rb for emacs-orgmode@gnu.org; Tue, 19 Feb 2013 19:06:51 -0500 Received: from BigDog.local (pool-72-89-40-63.nycmny.fios.verizon.net [72.89.40.63]) by mail.rickster.com (Postfix) with ESMTPS id 36E8B20BD6 for ; Tue, 19 Feb 2013 19:06:51 -0500 (EST) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * lisp/ox-html.el: (org-export-define-backend): add css url option (org-export-htmlized-org-css-url): modify docstring and options. (org-html--build-style): include css-url if specified. --- lisp/ox-html.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 1800f5e..58dc4a5 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -122,6 +122,7 @@ (:html-style-include-default nil nil org-html-style-include-default) (:html-style-include-scripts nil nil org-html-style-include-scripts) (:html-table-tag nil nil org-html-table-tag) + (:html-htmlized-css-url "HTML_HTMLIZED_CSS_URL" nil org-html-htmlized-org-css-url) ;; Redefine regular options. (:creator "CREATOR" nil org-html-creator-string) (:with-latex nil "tex" org-html-with-latex) @@ -548,11 +549,11 @@ create CSS to define the font colors. However, this does not work when converting in batch mode, and it also can look bad if different people with different fontification setup work on the same website. When this variable is non-nil, creating an htmlized version of an Org buffer -using `org-export-as-org' will remove the internal CSS section and replace it -with a link to this URL." +using `org-export-as-org' will include a link to this URL if the +setting of `org-html-htmlize-output-type' is 'css." :group 'org-export-html :type '(choice - (const :tag "Keep internal css" nil) + (const :tag "Don't include external stylesheet link" nil) (string :tag "URL or local href"))) @@ -1255,8 +1256,13 @@ INFO is a plist used as a communication channel." INFO is a plist used as a communication channel." (org-element-normalize-string (concat - (when (plist-get info :html-style-include-default) org-html-style-default) + (when (plist-get info :html-style-include-default) + (org-element-normalize-string org-html-style-default)) (org-element-normalize-string (plist-get info :html-style)) + (when (and (plist-get info :html-htmlized-css-url) + (eq org-html-htmlize-output-type 'css)) + (format "\n" + (plist-get info :html-htmlized-css-url))) (org-element-normalize-string (plist-get info :html-style-extra)) (when (plist-get info :html-style-include-scripts) org-html-scripts)))) -- 1.8.1.2