From: Charles Philip Chan <cpchan@bell.net>
To: Org-mode <emacs-orgmode@gnu.org>
Subject: Exporting xml and html code with syntax highlight
Date: Fri, 31 Aug 2012 01:46:21 -0400 [thread overview]
Message-ID: <BLU0-SMTP20011E151BE1F2A83E12EFBBA60@phx.gbl> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 281 bytes --]
Hello all:
Tonight I had a need to export some xml code with syntax highlight. I
figured that the best way to do it is to modify ob-css.el (by a simple
search and replace). To my delight, it work, so I did one for html
also. I hope people will find them useful.
Cheers,
Charles
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: ob-xml.el --]
[-- Type: text/x-emacs-lisp, Size: 1463 bytes --]
;;; ob-xml.el --- org-babel functions for xml evaluation
;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Since xml can't be executed, this file exists solely for tangling
;; xml from org-mode files.
;;; Code:
(require 'ob)
(defvar org-babel-default-header-args:xml '())
(defun org-babel-execute:xml (body params)
"Execute a block of xml code.
This function is called by `org-babel-execute-src-block'."
body)
(defun org-babel-prep-session:xml (session params)
"Return an error if the :session header argument is set.
xml does not support sessions."
(error "xml sessions are nonsensical"))
(provide 'ob-xml)
;;; ob-xml.el ends here
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: ob-html.el --]
[-- Type: text/x-emacs-lisp, Size: 1475 bytes --]
;;; ob-html.el --- org-babel functions for html evaluation
;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Since html can't be executed, this file exists solely for tangling
;; html from org-mode files.
;;; Code:
(require 'ob)
(defvar org-babel-default-header-args:html '())
(defun org-babel-execute:html (body params)
"Execute a block of html code.
This function is called by `org-babel-execute-src-block'."
body)
(defun org-babel-prep-session:html (session params)
"Return an error if the :session header argument is set.
html does not support sessions."
(error "html sessions are nonsensical"))
(provide 'ob-html)
;;; ob-html.el ends here
[-- Attachment #1.4: Type: text/plain, Size: 125 bytes --]
--
"Open Standards, Open Documents, and Open Source"
-- Scott Bradner (Open Sources, 1999 O'Reilly and Associates)
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next reply other threads:[~2012-08-31 5:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-31 5:46 Charles Philip Chan [this message]
2012-08-31 6:13 ` Exporting xml and html code with syntax highlight Bastien
2012-08-31 7:10 ` Charles Philip Chan
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=BLU0-SMTP20011E151BE1F2A83E12EFBBA60@phx.gbl \
--to=cpchan@bell.net \
--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).