emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Timothy <orgmode@tec.tecosaur.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [POLL] Naming of "export features"
Date: Wed, 22 Feb 2023 12:23:10 +0000	[thread overview]
Message-ID: <871qmhdh3l.fsf@localhost> (raw)
In-Reply-To: <87h6vfnl3a.fsf@tec.tecosaur.net>

Timothy <orgmode@tec.tecosaur.net> writes:

> Here is a list of terms which I’d feel comfortable applying to the system:
> ⁃ export features
> ⁃ export capabilities
> ⁃ export snippets

I am looking at the concept again, and I feel that we may be missing
some flexibility here. I do not like the fact that each feature can only
have a simple implementation within specific backend.

Imagine that we would like add a top _and also_ bottom comment when the
Org buffer contains emoji. With the proposed patch, it will be
impossible.

I am thinking about something conceptually similar, but more general.

Instead of detecting "features" in the whole document, let's consider
that for every exported Org element (including org-data, representing
the whole document) we may emit different export output depending on
certain condition being satisfied for either original Org raw source of
the exported element, the element AST, or the exported element contents.
Let's call it "transcoder conditions".

What I have in mind is an ability to parametrize the transcoders like
the following:

(org-export-define-backend 'html
 '((paragraph . ((paragraph-is-a-link? figure-transcoder :name figure)
                 (:unless 'figure paragraph-transcoder))))
 :transcoder-conditions
 '((paragraph . ((paragraph-is-a-link? (lambda (paragraph contents info)...))))))

Several ideas in the above:
1. Name features as "transcoder conditions"
2. The transcoder conditions are now linked to specific Org AST element.
   They may not only be matched against the whole parse tree + whole raw
   Org text, but also against the specific branch of AST + chunk of raw
   Org text corresponding to the branch + the actual exported contents
   of the AST children.
3. "feature implementations" are no longer needed. Instead, export
   transcoders can contain the implementation lists inline. Each
   implementation is selected not only depending on the presence of the
   "feature"/transcoder condition, but also depending on multiple
   features or arbitrary lisp expression results.
4. :when/:prevents apply to specific (possibly named) implementations.
   This makes more sense than matching against feature.
   For example, presence of svg images in latex export may or may not
   mean that \usepackage{svg} is being used, depending on svg
   implementation. We want to match against \usepackage{svg}
   specifically rather than only against the presence of svg images.

WDYT?

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


  parent reply	other threads:[~2023-02-22 12:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 17:20 [PATCH] Introduce "export features" Timothy
2023-02-11 11:37 ` Ihor Radchenko
2023-02-20 17:41 ` Timothy
2023-02-24 12:51   ` Sébastien Miquel
2023-02-24 12:59     ` Ihor Radchenko
2023-02-24 21:47       ` Sébastien Miquel
2023-02-26 12:19         ` Ihor Radchenko
2023-02-26 13:04           ` Sébastien Miquel
2023-02-27 19:05             ` Ihor Radchenko
2023-02-25  3:15     ` Timothy
2023-02-21 14:22 ` [POLL] Naming of " Timothy
2023-02-22  1:46   ` Dr. Arne Babenhauserheide
2023-02-22  2:40     ` Timothy
2023-02-23 15:55       ` No Wayman
2023-02-23 16:17         ` No Wayman
2023-02-22 12:23   ` Ihor Radchenko [this message]
2023-02-23 15:31     ` No Wayman
2023-02-23 16:04     ` Bruce D'Arcus
2023-02-23 19:04       ` Ihor Radchenko
2023-02-23 19:55     ` Sébastien Miquel
2023-02-24 10:27       ` Ihor Radchenko
2023-02-24 12:46         ` Sébastien Miquel
2023-02-24 13:03           ` Ihor Radchenko
2023-02-24 21:38             ` Sébastien Miquel
2023-02-26 12:28               ` Ihor Radchenko
2023-02-26 14:06                 ` Sébastien Miquel
2023-02-27 19:32                   ` Ihor Radchenko
     [not found] <mailman.336.1676990100.5072.emacs-orgmode@gnu.org>
2023-02-23 15:06 ` No Wayman
  -- strict thread matches above, loose matches on Subject: below --
2023-03-01  8:26 Pedro Andres Aranda Gutierrez
2023-03-01  9:41 ` Ihor Radchenko
2023-03-01 11:38   ` Pedro Andres Aranda Gutierrez
2023-03-02 11:30     ` 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=871qmhdh3l.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=orgmode@tec.tecosaur.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).