From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: How to easily create a new export engine... Date: Wed, 04 Sep 2013 19:37:17 +0800 Message-ID: <87wqmwkec2.fsf@ericabrahamsen.net> References: <20130903135112.GF22460@kuru.dyndns-at-home.com> <87mwnu2ecd.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHBOB-00029G-Eg for emacs-orgmode@gnu.org; Wed, 04 Sep 2013 07:36:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHBO4-0004zh-4d for emacs-orgmode@gnu.org; Wed, 04 Sep 2013 07:36:47 -0400 Received: from plane.gmane.org ([80.91.229.3]:48425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHBO3-0004zZ-UD for emacs-orgmode@gnu.org; Wed, 04 Sep 2013 07:36:40 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VHBO1-0008EQ-7M for emacs-orgmode@gnu.org; Wed, 04 Sep 2013 13:36:37 +0200 Received: from 114.252.245.6 ([114.252.245.6]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Sep 2013 13:36:37 +0200 Received: from eric by 114.252.245.6 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Sep 2013 13:36:37 +0200 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: emacs-orgmode@gnu.org flammable project writes: > Thanks Nocolas and Suvayu, > > > I will spend some time on ox-md.el and the section listed by Nicolas. > > One last question: > If I choose to extend the existing back-end, would I be able to put > all the code into a external file and allow the user to load it > through it emacs config file?  > I mean, I would like to add a support of Twitter Bootstrap trough the > ox-html.el export engine. If the user add "(require > 'ox-html-bootstrap)" into its ".emacs" file, it will allow the user > to extend the ox-html export engine. > Does it seems possible? The trick here is that your file calls (require 'ox-html) at the top (maybe requiring org itself is a good idea), and (provide 'ox-bootstrap) at the bottom. When writing your mode, you've required ox-html at the top, so in the rest of the file you can override or build on the ox-html functions, and at the bottom you provide users with everything you've done. When users require your module, they will then require everything you've required, thus loading the whole chain of dependencies that are necessary for your module. They can go from zero to having all of org mode loaded, simply by requiring your file. Provided you've required all the necessary modules, of course! E