And this second patch adds support for html rendering with klipse.  The
default CSS leaves a little to be desired!


On Wed, Dec 14, 2016 at 5:44 PM, Matt Price <mopto...@gmail.com> wrote:

>
> I'm such a slow coder that this is all I got to in my free moments
> today:patch for defcustoms that inserts the necessary code into a src
> block.  further refinements necessary before it works properly; severla
> more would be useful for hte improvements that Bastien suggests.
>
>
> On Wed, Dec 14, 2016 at 12:55 PM, Matt Price <mopto...@gmail.com> wrote:
>
>>
>>
>>
>> On Wed, Dec 14, 2016 at 5:06 AM, Rasmus <ras...@gmx.us> wrote:
>>
>>>
>>> I don’t know if much more support is needed.  We add some automatic
>>> configuration scripting or add a per-block switch for enabling klipse.
>>>
>>> Two more little things. HTML blocks can't use the standard editor so
>> they need an extra attribute `data-editor-style="html"`
>>
>>
>>
From 14433dc75b859de880f2cc135415ef6de54efe74 Mon Sep 17 00:00:00 2001
From: Matt Price <matt.pr...@utoronto.ca>
Date: Wed, 14 Dec 2016 20:15:04 -0500
Subject: [PATCH 2/2] Add basic support for html rendering

Insert 'data-editor-type="html"' into <pre> tag when exporting
klipsified html blocks.
---
 lisp/ox-html.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 2704f84..a9c8b5d 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -3345,11 +3345,13 @@ CONTENTS holds the contents of the item.  INFO is a plist holding
 contextual information."
   (if (org-export-read-attribute :attr_html src-block :textarea)
       (org-html--textarea-block src-block)
-    (let ((lang (org-element-property :language src-block))
+    (let* ((lang (org-element-property :language src-block))
 	  (code (org-html-format-code src-block info))
 	  (label (let ((lbl (and (org-element-property :name src-block)
 				 (org-export-get-reference src-block info))))
-		   (if lbl (format " id=\"%s\"" lbl) ""))))
+		   (if lbl (format " id=\"%s\"" lbl) "")))
+	  (klipsify  (and  org-reveal-klipsify-src
+                           (member lang '("javascript" "js" "ruby" "scheme" "clojure" "php" "html")))))
       (if (not lang) (format "<pre class=\"example\"%s>\n%s</pre>" label code)
 	(format "<div class=\"org-src-container\">\n%s%s\n</div>"
 		;; Build caption.
@@ -3366,8 +3368,8 @@ contextual information."
 			      listing-number
 			      (org-trim (org-export-data caption info))))))
 		;; Contents.
-		(format "<pre class=\"src src-%s\"%s>%s</pre>"
-			lang label code))))))
+		(format "<pre class=\"src src-%s\"%s%s>%s</pre>"
+			lang label (if (and klipsify (string= lang "html"))" data-editor-type=\"html\"" "") code))))))
 
 ;;;; Statistics Cookie
 
-- 
2.10.2

Reply via email to