emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to easily create a new export engine...
@ 2013-09-03 13:37 flammable project
  2013-09-03 13:51 ` Suvayu Ali
  0 siblings, 1 reply; 6+ messages in thread
From: flammable project @ 2013-09-03 13:37 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

Hi all,

I'm looking for informations on how to create a new exporter based on the
new export engine.

I want to convert org files into HTML files in which some "functions" from
Twitter Bootstrap framework will be instantiated via Emacs and Org-Mode.

I'm quite fustrated because the org-export_generic.el file is obsolete and
I tried to use ox.el ox-ascii.el files but I was discouraged by their heavy
contents.

Could you please tell how to easily find a good starting "point" ?

Thanks

Basile

[-- Attachment #2: Type: text/html, Size: 725 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to easily create a new export engine...
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Suvayu Ali @ 2013-09-03 13:51 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Sep 03, 2013 at 03:37:05PM +0200, flammable project wrote:
> Hi all,
> 
> I'm looking for informations on how to create a new exporter based on the
> new export engine.
> 
> I want to convert org files into HTML files in which some "functions" from
> Twitter Bootstrap framework will be instantiated via Emacs and Org-Mode.
> 
> I'm quite fustrated because the org-export_generic.el file is obsolete and
> I tried to use ox.el ox-ascii.el files but I was discouraged by their heavy
> contents.
> 
> Could you please tell how to easily find a good starting "point" ?

You could take a look at ox-md.el; it derives from ox-html.el.  Since
you want to add to ox-html.el, that might be a nice starting point.

Needless to say, you should probably wait for Nicolas's comment.  He is
the expert, I'm just a user who looks at the source from time to time
;).

GL

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to easily create a new export engine...
  2013-09-03 13:51 ` Suvayu Ali
@ 2013-09-03 14:02   ` Nicolas Goaziou
  2013-09-03 20:14     ` flammable project
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2013-09-03 14:02 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

Hello,

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Tue, Sep 03, 2013 at 03:37:05PM +0200, flammable project wrote:
>> Hi all,
>> 
>> I'm looking for informations on how to create a new exporter based on the
>> new export engine.
>> 
>> I want to convert org files into HTML files in which some "functions" from
>> Twitter Bootstrap framework will be instantiated via Emacs and Org-Mode.
>> 
>> I'm quite fustrated because the org-export_generic.el file is obsolete and
>> I tried to use ox.el ox-ascii.el files but I was discouraged by their heavy
>> contents.
>> 
>> Could you please tell how to easily find a good starting "point" ?
>
> You could take a look at ox-md.el; it derives from ox-html.el.  Since
> you want to add to ox-html.el, that might be a nice starting point.
>
> Needless to say, you should probably wait for Nicolas's comment.  He is
> the expert, I'm just a user who looks at the source from time to time
> ;).

The OP could also look at "12.13 Advanced configuration" from Org
manual. There's an example on how to extend an existing back-end.

There's also `org-export-define-derived-backend' docstring.

If the new exporter is not meant for public consumption and would always
be used instead of regular html back-end, defadvices are also fine.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to easily create a new export engine...
  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
  0 siblings, 2 replies; 6+ messages in thread
From: flammable project @ 2013-09-03 20:14 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1984 bytes --]

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?

Thanks






2013/9/3 Nicolas Goaziou <n.goaziou@gmail.com>

> Hello,
>
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
>
> > On Tue, Sep 03, 2013 at 03:37:05PM +0200, flammable project wrote:
> >> Hi all,
> >>
> >> I'm looking for informations on how to create a new exporter based on
> the
> >> new export engine.
> >>
> >> I want to convert org files into HTML files in which some "functions"
> from
> >> Twitter Bootstrap framework will be instantiated via Emacs and Org-Mode.
> >>
> >> I'm quite fustrated because the org-export_generic.el file is obsolete
> and
> >> I tried to use ox.el ox-ascii.el files but I was discouraged by their
> heavy
> >> contents.
> >>
> >> Could you please tell how to easily find a good starting "point" ?
> >
> > You could take a look at ox-md.el; it derives from ox-html.el.  Since
> > you want to add to ox-html.el, that might be a nice starting point.
> >
> > Needless to say, you should probably wait for Nicolas's comment.  He is
> > the expert, I'm just a user who looks at the source from time to time
> > ;).
>
> The OP could also look at "12.13 Advanced configuration" from Org
> manual. There's an example on how to extend an existing back-end.
>
> There's also `org-export-define-derived-backend' docstring.
>
> If the new exporter is not meant for public consumption and would always
> be used instead of regular html back-end, defadvices are also fine.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>
>

[-- Attachment #2: Type: text/html, Size: 4000 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to easily create a new export engine...
  2013-09-03 20:14     ` flammable project
@ 2013-09-04 10:15       ` Rasmus
  2013-09-04 11:37       ` Eric Abrahamsen
  1 sibling, 0 replies; 6+ messages in thread
From: Rasmus @ 2013-09-04 10:15 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

flammable project <flammable.project@gmail.com> writes:

> 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?

Yes.  Just make NAME.el and end the file by providing NAME (provide
'NAME).

> 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?

Yeah, that's possible with the derived backend.  Indeed, that would
seem like on of the main usages.  In the simplest case you'd just add
an option to export dispatcher and people would have to select it when
they want to use twitter bootstrap (whatever that is. . .).

–Rasmus

-- 
In theory, practice and theory are the same. In practice they are not

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to easily create a new export engine...
  2013-09-03 20:14     ` flammable project
  2013-09-04 10:15       ` Rasmus
@ 2013-09-04 11:37       ` Eric Abrahamsen
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2013-09-04 11:37 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-04 11:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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).