From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: getting item information in an export filter? Date: Mon, 3 Feb 2020 16:13:07 -0500 Message-ID: References: <87mu9z8xn0.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007151a3059db264a8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35264) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyj24-0006Yk-Gy for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 16:13:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyj22-0007oZ-5G for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 16:13:24 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:51766) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iyj20-0007hs-Pg for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 16:13:21 -0500 Received: by mail-wm1-x336.google.com with SMTP id t23so897774wmi.1 for ; Mon, 03 Feb 2020 13:13:19 -0800 (PST) In-Reply-To: <87mu9z8xn0.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: John Kitchin , org-mode-email --0000000000007151a3059db264a8 Content-Type: text/plain; charset="UTF-8" Thanks Nicolas! John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Mon, Feb 3, 2020 at 11:26 AM Nicolas Goaziou wrote: > Hello, > > John Kitchin writes: > > > In > > > https://emacs.stackexchange.com/questions/55231/org-mode-export-html-add-name-attirbute-to-checkbox-input > > > > there was a question about modifying a checkbox export. I wrote an answer > > using a custom translate function in a derived backend, where I could get > > the name of the parent list pretty easily. > > > > It seems like that should also be possible in a filter, but I don't > > understand how to find the parent list in that case. I think it is buried > > in the info. > > > > Is there a general way to get to the org-element information for > something > > in an export filter function? > > No, there's no simple way to access the element. Filters, with a few > exceptions, are meant to operate on strings, not on the parse tree. They > are usual meant as a simple way to transform the output. I.e., they are > intentionally dumbed down. > > You could however, use the parse-tree filter to modify the parse tree > before export. > > Regards, > > -- > Nicolas Goaziou > --0000000000007151a3059db264a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Nicolas!=C2=A0

John

-----------------------------= ------
Professor John Kitchin=C2=A0
Doherty Hall A207F
Department = of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 152= 13
412-268-7803


On Mon, Feb 3, 2020= at 11:26 AM Nicolas Goaziou <= mail@nicolasgoaziou.fr> wrote:
Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> In
> https://emacs.stackexchange.com/questions/55231/org-mode-export= -html-add-name-attirbute-to-checkbox-input
>
> there was a question about modifying a checkbox export. I wrote an ans= wer
> using a custom translate function in a derived backend, where I could = get
> the name of the parent list pretty easily.
>
> It seems like that should also be possible in a filter, but I don'= t
> understand how to find the parent list in that case. I think it is bur= ied
> in the info.
>
> Is there a general way to get to the org-element information for somet= hing
> in an export filter function?

No, there's no simple way to access the element. Filters, with a few exceptions, are meant to operate on strings, not on the parse tree. They are usual meant as a simple way to transform the output. I.e., they are
intentionally dumbed down.

You could however, use the parse-tree filter to modify the parse tree
before export.

Regards,

--
Nicolas Goaziou
--0000000000007151a3059db264a8--