emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Make html exporter respect css-url configuration variable.
@ 2013-02-20  0:06 Rick Frankel
  2013-02-25 12:01 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Rick Frankel @ 2013-02-20  0:06 UTC (permalink / raw)
  To: emacs-orgmode

* 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 "<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\" />\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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make html exporter respect css-url configuration variable.
  2013-02-20  0:06 [PATCH] Make html exporter respect css-url configuration variable Rick Frankel
@ 2013-02-25 12:01 ` Nicolas Goaziou
  2013-02-25 13:04   ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2013-02-25 12:01 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Rick Frankel <rick@rickster.com> writes:

> * 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.

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make html exporter respect css-url configuration variable.
  2013-02-25 12:01 ` Nicolas Goaziou
@ 2013-02-25 13:04   ` Nicolas Goaziou
  2013-03-02 17:47     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2013-02-25 13:04 UTC (permalink / raw)
  To: emacs-orgmode

By the way, `org-html-htmlized-org-css-url' docstring looks wrong.
`org-export-as-org' doesn't exist anymore, neither do "batch mode".

So, is the variable still useful? If it is, could someone could fix its
docstring so it reflects what is really happening?

Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make html exporter respect css-url configuration variable.
  2013-02-25 13:04   ` Nicolas Goaziou
@ 2013-03-02 17:47     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2013-03-02 17:47 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> By the way, `org-html-htmlized-org-css-url' docstring looks wrong.
> `org-export-as-org' doesn't exist anymore, neither do "batch mode".
>
> So, is the variable still useful? If it is, could someone could fix its
> docstring so it reflects what is really happening?

It is useful if org-org-publish-to-org handles :htmlized-source from
publishing projects.  I resurrected this functionality, see my recent
commit.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-02 18:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-20  0:06 [PATCH] Make html exporter respect css-url configuration variable Rick Frankel
2013-02-25 12:01 ` Nicolas Goaziou
2013-02-25 13:04   ` Nicolas Goaziou
2013-03-02 17:47     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).