emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Weiner <rsw@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: How to fully control parsing of Org mode links during export
Date: Fri, 16 Aug 2024 01:26:30 -0400	[thread overview]
Message-ID: <CA+OMD9hcVWuzEUAfRTVMcxhLf40j1DPkmqt6H1nXAkuOtm5RDg@mail.gmail.com> (raw)
In-Reply-To: <87ikwxmszy.fsf@localhost>

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

Thank you for the pointers on this, Ihor.  That led me down a much better
path that worked.  In the end, I just had the export function for my
specific link type and had to add a before advice on
org-element--generate-copy-script since it lacks a hook at its end.  I
would suggest adding one as this seems to be the place if you want to
change the markup in the copied buffer before Org formats it for export.
Is there any other existing hook that runs before formatting in this copied
buffer?

Thanks. -- Robert

On Mon, Jul 22, 2024 at 9:53 AM Ihor Radchenko <yantar92@posteo.net> wrote:

> Robert Weiner <rsw@gnu.org> writes:
>
> > I could really use some help from Org export experts.  I have
> > been trying to tweak export link parsing to do what I want
> > without any success.  Here is a summary of the issues and related
> > questions I have.
>
> You generally should not need to modify the _parser_.
> What you may need to do is modifying the exporter.
> For example, by defining a custom export backend. Or export filter.
> See "13.17 Advanced Export Configuration" section of the manual.
>
> > 3. When exporting from an Org file and I have defined the html export
> >    syntax for mytype: to html, I want this:
> >      [[mytype:MyLink]]
> >      [[Testing]]
> >    to be converted into this:
> >      <a href="MyLink.html">MyLink</a>
> >      <a href="Testing.html">Testing</a>
> >    but instead Org export produces:
> >      <a href="<a href="MyLink.html">MyLink</a>.html">mytype:<a
> > href="Testing.html">Testing</a></a>
>
> This has nothing to do with Org mode exporter. What is produced for
> custom link types totally depends on the custom :export function you
> defined for your link.
>
> > 2. How can I get the exporter to run in my current Emacs process and
> >    spawn a new Emacs so that I can easily debug in-process?  I think I
> have
> >    turned off the async export option but it still runs async and I can't
> >    step through the exporter functions.
>
> Async is disabled by default. So, something in your config enables
> it.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

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

  reply	other threads:[~2024-08-16  5:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21 17:19 How to fully control parsing of Org mode links during export Robert Weiner
2024-07-21 18:19 ` Orm Finnendahl
2024-07-22  1:16   ` Robert Weiner
2024-07-22  4:01     ` Robert Weiner
2024-07-22 13:54 ` Ihor Radchenko
2024-08-16  5:26   ` Robert Weiner [this message]
2024-08-18 13:13     ` Ihor Radchenko

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=CA+OMD9hcVWuzEUAfRTVMcxhLf40j1DPkmqt6H1nXAkuOtm5RDg@mail.gmail.com \
    --to=rsw@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=rswgnu@gmail.com \
    --cc=yantar92@posteo.net \
    /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).