From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baoqiu Cui Subject: Export Org files to TWiki format Date: Thu, 07 May 2009 21:05:05 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M2HKw-0006jY-O6 for emacs-orgmode@gnu.org; Fri, 08 May 2009 00:05:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M2HKs-0006hX-96 for emacs-orgmode@gnu.org; Fri, 08 May 2009 00:05:26 -0400 Received: from [199.232.76.173] (port=45259 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M2HKs-0006hT-2G for emacs-orgmode@gnu.org; Fri, 08 May 2009 00:05:22 -0400 Received: from main.gmane.org ([80.91.229.2]:33407 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M2HKr-0002vG-G4 for emacs-orgmode@gnu.org; Fri, 08 May 2009 00:05:21 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1M2HKm-00085h-U6 for emacs-orgmode@gnu.org; Fri, 08 May 2009 04:05:16 +0000 Received: from nat-dip6.cfw-a-gci.corp.yahoo.com ([209.131.62.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 May 2009 04:05:16 +0000 Received: from cbaoqiu by nat-dip6.cfw-a-gci.corp.yahoo.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 May 2009 04:05:16 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Recently I wrote an XSL stylesheet that converts DocBook documents to TWiki (http://www.twiki.org/) format, and it can be used to convert Org files to TWiki format using DocBook exporter as a bridge. I have used it to generate some of my recent TWiki documents at work from Org mode files, and it worked pretty well. Now Org-mode can be used as a TWiki editor. If you are interested, you can get the stylesheet from http://docbook2twiki.googlecode.com The following Elisp function can be used to export Org file to TWiki using this stylesheet (the only external tool that you need is ``xsltproc''): (defun org-export-as-twiki () "Export Org file to TWiki." (interactive) (message "Exporting to TWiki...") (let* ((wconfig (current-window-configuration)) (docbook-buf (org-export-as-docbook)) (filename (buffer-file-name docbook-buf)) (base (file-name-sans-extension filename)) (twiki-file (concat base ".twiki"))) (and (file-exists-p twiki-file) (delete-file twiki-file)) (message "Processing DocBook XML file...") (shell-command (format "xsltproc --output %s /Users/bcui/docbook2twiki/docbook2twiki.xsl %s" twiki-file (shell-quote-argument filename))) (message "Processing DocBook file...done") (if (not (file-exists-p twiki-file)) (error "TWiki file was not produced") (set-window-configuration wconfig) (message "Exporting to TWiki...done") twiki-file))) Originally I started with writing Org-to-TWiki exporter in Elisp, but realized that I had to duplicate a lot of code from the DocBook exporter after 99% of the work was done. Writing the stylesheet is little harder for me, but it proves that DocBook exporter can be helpful in some case. ;-) Please let me know if you have any comments. Thanks, Baoqiu