From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: getting item information in an export filter? Date: Mon, 3 Feb 2020 09:15:43 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b61b43059dac8f39" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34566) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iycW7-0005La-Iy for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 09:16:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iycW6-0006pA-EC for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 09:15:59 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:55791) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iycW5-0006nu-1Q for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 09:15:57 -0500 Received: by mail-wm1-x332.google.com with SMTP id q9so16061110wmj.5 for ; Mon, 03 Feb 2020 06:15:56 -0800 (PST) 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: org-mode-email --000000000000b61b43059dac8f39 Content-Type: text/plain; charset="UTF-8" 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? 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 --000000000000b61b43059dac8f39 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In=C2=A0https:/= /emacs.stackexchange.com/questions/55231/org-mode-export-html-add-name-atti= rbute-to-checkbox-input

there was a question about m= odifying a checkbox export. I wrote an answer using a custom translate func= tion in a derived backend, where I could get the name of the parent list pr= etty easily.=C2=A0

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 somethi= ng in an export filter function?

John

-----------------------------= ------
Professor John Kitchin=C2=A0
Doherty Hall A207F
Department = of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 152= 13
412-268-7803
--000000000000b61b43059dac8f39-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: getting item information in an export filter? Date: Mon, 03 Feb 2020 17:05:07 +0100 Message-ID: <87mu9z8xn0.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:40726) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyeDz-0000Kv-B7 for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 11:05:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyeDx-0003nJ-Jl for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 11:05:22 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:55053) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iyeDx-0003Ze-Bq for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 11:05:21 -0500 In-Reply-To: (John Kitchin's message of "Mon, 3 Feb 2020 09:15:43 -0500") 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 Cc: org-mode-email 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 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--