emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "N. Raghavendra" <nyraghu27132@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] ox-html.el: Fix display of language indicators for source blocks
Date: Tue, 19 Sep 2017 22:48:34 +0530	[thread overview]
Message-ID: <877ewuehed.fsf@gmail.com> (raw)
In-Reply-To: <87tvzzecdu.fsf@gmail.com> (N. Raghavendra's message of "Tue, 19 Sep 2017 06:24:37 +0530")

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

At 2017-09-19T06:24:37+05:30, N. Raghavendra wrote:

> Attached is a patch that implements these changes.

Attached is a simplified patch with an unnecessary conditional removed.

Raghu.

-- 
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-html.el-Partially-revert-d5bbf36553.patch --]
[-- Type: text/x-diff, Size: 2464 bytes --]

From 392d26f3c112c51661e494f4cbb0c4b30e2a8302 Mon Sep 17 00:00:00 2001
From: "N. Raghavendra" <raghu@hri.res.in>
Date: Tue, 19 Sep 2017 22:37:02 +0530
Subject: [PATCH] ox-html.el: Partially revert d5bbf36553

* lisp/ox-html.el (org-html-src-block): Unless klipse is used, export
source code blocks as content of `pre' elements, and not as content of
`code' children of `pre' elements.  Restores the previous way of
exporting source code blocks, and fixes the display of language
indicators while hovering over the blocks in the exported HTML file,
when klipse is not used.
(org-html-keep-old-src): Remove it.  Not needed because it is now the
default, unless klipse is used.
---
 lisp/ox-html.el | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index ebb233b..d91ca73 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -174,7 +174,6 @@
     (:html-klipsify-src nil nil org-html-klipsify-src)
     (:html-klipse-css nil nil org-html-klipse-css)
     (:html-klipse-js nil nil org-html-klipse-js)
-    (:html-klipse-keep-old-src nil nil org-html-keep-old-src)
     (:html-klipse-selection-script nil nil org-html-klipse-selection-script)
     (:infojs-opt "INFOJS_OPT" nil nil)
     ;; Redefine regular options.
@@ -1572,12 +1571,6 @@ https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag"
   :package-version '(Org . "9.1")
   :type 'string)
 
-(defcustom org-html-keep-old-src nil
-  "When non-nil, use <pre class=\"\"> instead of <pre><code class=\"\">."
-  :group 'org-export-html
-  :package-version '(Org . "9.1")
-  :type 'boolean)
-
 
 ;;;; Todos
 
@@ -3384,12 +3377,16 @@ contextual information."
 			      listing-number
 			      (org-trim (org-export-data caption info))))))
 		;; Contents.
-		(let ((open (if org-html-keep-old-src "<pre" "<pre><code"))
-		      (close (if org-html-keep-old-src "</pre>" "</code></pre>")))
-		  (format "%s class=\"src src-%s\"%s%s>%s%s"
-			  open lang label (if (and klipsify (string= lang "html"))
-					      " data-editor-type=\"html\"" "")
-			  code close)))))))
+		(if klipsify
+		    (format "<pre><code class=\"src src-%s\"%s%s>%s</code></pre>"
+			    lang
+			    label
+			    (if (string= lang "html")
+				" data-editor-type=\"html\""
+			      "")
+			    code)
+		  (format "<pre class=\"src src-%s\"%s>%s</pre>"
+                          lang label code)))))))
 
 ;;;; Statistics Cookie
 
-- 
2.7.4


  reply	other threads:[~2017-09-19 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 15:20 [PATCH] ox-html.el: Fix display of language indicators for source blocks N. Raghavendra
2017-06-06 20:08 ` N. Raghavendra
2017-06-08 18:57 ` N. Raghavendra
2017-06-08 19:24   ` Nicolas Goaziou
2017-06-08 19:42     ` N. Raghavendra
2017-06-12 16:45       ` Matt Price
2017-06-14 17:32         ` N. Raghavendra
2017-09-19  0:54           ` N. Raghavendra
2017-09-19 17:18             ` N. Raghavendra [this message]
2017-09-19 20:02               ` Nicolas Goaziou
2017-06-08 20:15     ` Matt Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877ewuehed.fsf@gmail.com \
    --to=nyraghu27132@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).