From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill Powell Subject: Org-publish: adding a new format? Date: Wed, 10 Feb 2010 23:43:05 -0500 Message-ID: <878wb04c2u.wl%bill@billpowellisalive.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfQr7-0002fb-Et for emacs-orgmode@gnu.org; Wed, 10 Feb 2010 23:40:45 -0500 Received: from [199.232.76.173] (port=55039 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfQr7-0002fN-0j for emacs-orgmode@gnu.org; Wed, 10 Feb 2010 23:40:45 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfQr5-00063l-22 for emacs-orgmode@gnu.org; Wed, 10 Feb 2010 23:40:44 -0500 Received: from billpowellisalive.com ([206.130.115.110]:44294) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NfQr4-000639-MO for emacs-orgmode@gnu.org; Wed, 10 Feb 2010 23:40:42 -0500 Received: from shire.myhost.example.com (va-138-210-2-153.dhcp.embarqhsd.net [138.210.2.153] (may be forged)) by billpowellisalive.com (8.13.1/8.13.1) with ESMTP id o1B4eciS012889 for ; Wed, 10 Feb 2010 21:40:39 -0700 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 all, Does anyone have any suggestions for adding a new format to "org-publish"? Any articles, or threads on the mailing list? I've looked around but haven't found anywhere to start. I want to convert an org file to a tab-separated format, so that it can be imported into a flashcard program called Anki [[http://ichi2.net/anki/]]. The basic idea is that each *** header is a prompt, and the following text is the answer. *** Who wrote /War and Peace/? Leo Tolstoy. *** What is the preferred editor for using Org-mode? Windows Notepad. and so on. The catch is, I'd also like to preserve the *bold* and /italic/ formatting. Not to mention those awesome org-tables. Now, Anki understands HTML formatting. So, ideally, I can use the excellent export to HTML that org-publish already does. That's 95% of the work right there. In fact, I have already written a Perl script that takes an exported HTML file and chomps it into a .tsv. (Almost.) But although my elisp is pretty rudimentary, I have a couple reasons I'd like to implement this within org-publish instead: 1) I could share my work (at least by posting it on my web site; my elisp isn't ready for official contributions yet), and 2) It might make it easier to access the different org-elements directly. For instance, I use *** headers as prompts, so that I can use * and ** to organize the flashcards in the org-file. But, I would like to be able to save the * and ** headers, and use them as "tags" in the final Anki flashcard. (Anki lets you tag your flashcard.) Similarly, I'd like to convert org-mode :tags: as well. I can do all this in Perl, but it feels messy and inelegant, not to mention brittle. On the other hand, those who know org-publish may feel that this is a tall order for org-export-html-final-hook, and just the sort of job that Perl does best. Any thoughts? Thanks, Bill Powell