emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ken Williams <Ken.Williams@windlogics.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: More decoration for babel output
Date: Wed, 23 Jan 2013 16:26:54 +0000	[thread overview]
Message-ID: <DB9AE166BFBB0640B307A82E6F93D02601253F@SPEXCH02.WindLogics.local> (raw)

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

Hi all,

When exporting to HTML I always add some extra CSS to my org-mode config, for the purpose of identifying which chunks are input vs. output, and for identifying the language of the code in code chunks.  Language is identified by a little label on the box, and input/output is identified by green/red.

Would this be helpful to include by default?  Patch attached.

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com


________________________________

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution of any kind is strictly prohibited. If you are not the intended recipient, please contact the sender via reply e-mail and destroy all copies of the original message. Thank you.

[-- Attachment #2: 0001-Add-background-color-and-language-label-to-CSS-for-bab.txt --]
[-- Type: text/plain, Size: 1384 bytes --]

From 37ba52c7911b88c6879179311571654ded0273dd Mon Sep 17 00:00:00 2001
From: Ken Williams <Ken.Williams@WindLogics.com>
Date: Wed, 23 Jan 2013 10:14:50 -0600
Subject: [PATCH 1/1] Add background color and language-label to CSS for babel
 blocks.

---
 lisp/org-html.el |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 224a103..5e34385 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -170,6 +170,30 @@ for the JavaScript code in this tag.
         font-size: 90%;
         overflow:auto;
   }
+
+  /* Some decoration for source code blocks and their output. */
+  pre.src {
+    background-color: #F5FFF5;
+    position: relative;
+    overflow: visible;
+    margin-right: auto;
+  }
+  pre.src:before {
+    position: absolute;
+    top: -15px;
+    background: #ffffff;
+    padding: 1px;
+    border: 1px solid #000000;
+    font-size: small;
+  }
+  pre.src-sh:before   { content: 'sh'; }
+  pre.src-bash:before { content: 'sh'; }
+  pre.src-R:before    { content: 'R'; }
+  pre.src-perl:before { content: 'Perl'; }
+  pre.src-java:before { content: 'Java'; }
+  pre.src-sql:before  { content: 'SQL'; }
+  pre.example         { background-color: #FFF5F5; }
+
   table { border-collapse: collapse; }
   td, th { vertical-align: top;  }
   th.right  { text-align:center;  }
-- 
1.7.9


             reply	other threads:[~2013-01-23 16:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23 16:26 Ken Williams [this message]
2013-01-23 17:25 ` More decoration for babel output Gunnar Wolf
2013-01-24 17:05   ` Gunnar Wolf
2013-01-24 11:52 ` Bastien
2013-03-06  8:29 ` Bastien

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=DB9AE166BFBB0640B307A82E6F93D02601253F@SPEXCH02.WindLogics.local \
    --to=ken.williams@windlogics.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).