emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Marcin Borkowski <mbork@wmi.amu.edu.pl>
Cc: emacs-orgmode@gnu.org
Subject: Re: Extending the Org syntax by a custom exporter - how to do it?
Date: Wed, 26 Nov 2014 12:59:52 +0100	[thread overview]
Message-ID: <87k32imatj.fsf@selenimh.mobile.lan> (raw)
In-Reply-To: <874mtnezx9.fsf@wmi.amu.edu.pl> (Marcin Borkowski's message of "Tue, 25 Nov 2014 22:25:00 +0100")

Hello,

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Now that I actually started work on my exporter, I'd like to investigate
> this further.  The thing is, I'm not sure where to start.  First of all,
> I have a bit old Org-mode (without latex-math-blocks); I guess I'll just
> have to update it (I'll try to do an Elpa update in a minute).  But my
> question is:
>
> 1. Is it a good idea to instrument `org-latex--wrap-latex-math-block'
> for Edebug to learn what's happening?

Possibly, but you need to start out with a tiny document and have
`print-level' and `print-length' set to nil.

Anyway, it is a straightforward function: it looks for a math-related
object in the parse tree. When it finds one (which needs to be checked
first as type is an insufficient information), it inserts an empty
pseudo object before it. Then, it moves the math-related object, and
every contiguous math-related objects, within that pseudo object.

> 2. Is there any other (possibly simpler) instance of pseudo-blocks I
> could study?  It seems to me (from the docstring) that latex-math-blocks
> are a bit tricky; what I'm interested in is more like creating a new
> element similar to e.g. italics.

A slightly simpler example can be found in
`org-latex--wrap-latex-matrices' (I think you'll need to study
development version). There is also
`org-export--remove-uninterpreted-data-1' in "ox.el".

Anyway, an example of what you're trying to achieve would help.

> Also, if (when?) I "get it", I'm going to describe the process of adding
> a pseudo-object somewhere (I consider my blog, or maybe I could upload
> it to Worg?), so that other people can learn it easier.

I have a TODO to document it at

            http://orgmode.org/worg/dev/org-element-api.html

and add a short note on how to use them at

         http://orgmode.org/worg/dev/org-export-reference.html

However, I have the feeling that the UI is not complete yet. For
example, at the moment, pseudo-objects are mostly wrapped around
existing objects, so a function `org-element-wrap' (with DATUM START END
as arguments, assuming that START and END are siblings) may be
implemented.

Anyway, feel free to document it in the "official" references. We can
always update it later.


Regards,

-- 
Nicolas Goaziou

      parent reply	other threads:[~2014-11-26 11:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15 10:10 Extending the Org syntax by a custom exporter - how to do it? Marcin Borkowski
2014-03-15 11:10 ` John Kitchin
2014-03-15 11:25   ` Marcin Borkowski
2014-03-15 11:29     ` Marcin Borkowski
2014-03-15 21:22 ` Marcin Borkowski
2014-03-16 10:16   ` Nicolas Goaziou
2014-03-16 11:18     ` Marcin Borkowski
2014-03-16 11:57       ` Nicolas Goaziou
2014-03-16 13:33         ` Marcin Borkowski
2014-03-16 14:12           ` Nicolas Goaziou
2014-03-17 15:43             ` Marcin Borkowski
2014-03-16 16:05         ` Aaron Ecay
2014-03-17 16:31     ` Marcin Borkowski
2014-03-22 11:23       ` Nicolas Goaziou
2014-11-25 21:25     ` Marcin Borkowski
2014-11-25 21:46       ` Marcin Borkowski
2014-11-26  2:46       ` John Kitchin
2014-11-26 14:23         ` John Kitchin
2014-11-26 11:59       ` Nicolas Goaziou [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=87k32imatj.fsf@selenimh.mobile.lan \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=mbork@wmi.amu.edu.pl \
    /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).