emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-orgmode@gnu.org
Subject: Re: How to easily create a new export engine...
Date: Wed, 04 Sep 2013 19:37:17 +0800	[thread overview]
Message-ID: <87wqmwkec2.fsf@ericabrahamsen.net> (raw)
In-Reply-To: CAJzEwi8duy2gb5eLyR0sMu9u6CgpEHB7s_weCJjYmavphaoE8A@mail.gmail.com

flammable project <flammable.project@gmail.com> 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

      parent reply	other threads:[~2013-09-04 11:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 13:37 How to easily create a new export engine flammable project
2013-09-03 13:51 ` Suvayu Ali
2013-09-03 14:02   ` Nicolas Goaziou
2013-09-03 20:14     ` flammable project
2013-09-04 10:15       ` Rasmus
2013-09-04 11:37       ` Eric Abrahamsen [this message]

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=87wqmwkec2.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.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).