From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Philip Chan Subject: Exporting xml and html code with syntax highlight Date: Fri, 31 Aug 2012 01:46:21 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7K3M-0003SA-8W for emacs-orgmode@gnu.org; Fri, 31 Aug 2012 01:46:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7K3L-0007wG-0A for emacs-orgmode@gnu.org; Fri, 31 Aug 2012 01:46:00 -0400 Received: from blu0-omc1-s32.blu0.hotmail.com ([65.55.116.43]:61318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7K3K-0007w1-RU for emacs-orgmode@gnu.org; Fri, 31 Aug 2012 01:45:58 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-emacs-lisp Content-Disposition: inline; filename=ob-xml.el Content-Description: ob-xml.el ;;; 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 . ;;; 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 --=-=-= Content-Type: text/x-emacs-lisp Content-Disposition: inline; filename=ob-html.el Content-Description: ob-html.el ;;; 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 . ;;; 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 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 "Open Standards, Open Documents, and Open Source" -- Scott Bradner (Open Sources, 1999 O'Reilly and Associates) --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAlBAT7YACgkQ3epPyyKbwPZ7LQCgnKDKDSQoU6t+nK0NqQUMWk0L 7G4An084MeiA0vkFK6zAKzLqEvWSchg0 =49Ph -----END PGP SIGNATURE----- --==-=-=--