From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sEAoAITP6WEq3AAAgWs5BA (envelope-from ) for ; Thu, 20 Jan 2022 22:09:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oNCHNIPP6WHQEAAAG6o9tA (envelope-from ) for ; Thu, 20 Jan 2022 22:09:23 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 64F4019413 for ; Thu, 20 Jan 2022 22:09:23 +0100 (CET) Received: from localhost ([::1]:34764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAegM-00077f-Fk for larch@yhetil.org; Thu, 20 Jan 2022 16:09:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAZG1-0004JW-RK for emacs-orgmode@gnu.org; Thu, 20 Jan 2022 10:21:49 -0500 Received: from [2607:f8b0:4864:20::92d] (port=42816 helo=mail-ua1-x92d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAZFz-0004IH-JQ for emacs-orgmode@gnu.org; Thu, 20 Jan 2022 10:21:49 -0500 Received: by mail-ua1-x92d.google.com with SMTP id p1so11401026uap.9 for ; Thu, 20 Jan 2022 07:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j5GispASXe6w6R8gy7D5QHBlbNGB4Pj9dPwUZAt1ASk=; b=FL8ev6uPlHgZ4HoUb0oVyXHjG/iTnBYXeH20a3qmSAMqTID19Em3CJ1cAc3QJZA6qH HJigcHUmUmNlbpihzbwZOfMQ5Xv1wKqBP73xcwd9mEy+mfk3c7QNS1UZFDw3fBg77a6X ulheiCXY3w5ZGCeYr2d5ukZ930JnmsMONIi/h4qtVjoOCg2gXgZq0vMTw0pFRdS1GERW ANyE07kqDxsKv+faN/gZb6LDJ55BW8db45I0v9Q4abkQkr3f3mT/7eE3+f4aJTy16Iz6 HyoJlr+0Y42AyXjVLLikUm/QtSXKsAeVlbXa+7/KaVXuHpcJ1kwFpVL4/wBXYmelfmmi AY+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j5GispASXe6w6R8gy7D5QHBlbNGB4Pj9dPwUZAt1ASk=; b=b8AaSWezz5Ry/xwlLTLYRLdtxIk4kZEcbWv/hVoJHxr2qW18TSFMNgRsOhRTg1DFGR QvIG+2wIe3R85d760ZmRSxlddKPNKp5E2JGJJuV6F5KlGZbZpqwrk4Lis1uf43tcfkIl S8bbzyHtT194fCNQDMp8obPOGQ3VmaI3YHD+75McVjg8ErrRRtVw//Pwl9RZa9GsO7YL tLwqaMLo78P3Dc2S/EOG3R8Si9nFoDGULTg7DOASebqIF1QCWGcNlUhFifsvov85souN gP4QyTML7YWo/DBdq/lphttEMY+rnCJyLbrOyN4WCr7LHajkaxiO0SuFsdLc0GxUkgq0 1pMQ== X-Gm-Message-State: AOAM531Jw9S5akCBFMfQsO3557pdEZlh9b+AscLMqQqOys6XB5hOt58x TM3yd/c46EzHlJjUXdbhBShuXthqVyos0I49K6Q= X-Google-Smtp-Source: ABdhPJwfhI6FlJOQo0jgvI8UgKFBTD3Rizg67OVJnnjyEl8YDexWyf3n/YgIuTzDqm2w8p6RELwte+IOprUmn4sgVrI= X-Received: by 2002:a67:f882:: with SMTP id h2mr14454124vso.81.1642692106496; Thu, 20 Jan 2022 07:21:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Matt Price Date: Thu, 20 Jan 2022 10:21:35 -0500 Message-ID: Subject: Re: handling as special special block in derived export To: John Kitchin Content-Type: multipart/alternative; boundary="0000000000007baf3d05d6050f72" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::92d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::92d; envelope-from=moptop99@gmail.com; helo=mail-ua1-x92d.google.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.997 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642712963; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=j5GispASXe6w6R8gy7D5QHBlbNGB4Pj9dPwUZAt1ASk=; b=As1AstZ5rojMIJOGi1pdkAm3TfpMdTqjgyR5+Ym65kw9KH12xabV07KvHnTSLaTZ1HCrgY QEBkl62XYVdqWYb6y/undHCExXIzxsXXhYVmUtrEmi952XL092Fs/Wt25/4SNzoZ/yAr7L YeXsATCJH7RuS6JjMno9j5FJfPZJPbhfsKCPFJYb0kj+jZExXp0/sRLQhVQXxOMBDyiweK 6HhyXol21aft7CrAqr7HvxgaCjwLUpdpOjihADwoQLfYExuvDc9uPiXqXHGizi3DOKy4tW SCS91UZMNi5lAomQuc/FBIN67xI+8fn6okBtq19RA8sWLHlfpZbJvp0KP0cDAw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642712963; a=rsa-sha256; cv=none; b=BUcBu5e9ef2Ua6gQhBT1/FC7b9s9Rc7n2ucRIy5SNvBvZix7PeECWBhZXaurhHZs1U7DzY VKVmk8defERim8Fd1b+lwtXoW//yWbJRjs2sIUEIZTgnKBKAhG9tQ4UHPu8p5/CxPtUQLr uqRH1aQgfiz/FWUVY876V2Arjw4F1MP0nxn1bTI6QuVVKROaJ00GgFb+N9zXSoBidAj3i+ zVBnwLC2/2bZK++zksekgZfSERi5TDnzR4VI7zNvzKjh1tUqfSbfPUePumrUfHMoQOxXJh IUK/9KzDDala+r0cmPnbcol07f9bg4J3YMqQE47URG6TeYmvyxfO+qWhOESbwA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FL8ev6uP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FL8ev6uP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 64F4019413 X-Spam-Score: -5.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: 92NnUhb6vQGe --0000000000007baf3d05d6050f72 Content-Type: text/plain; charset="UTF-8" On Wed, Jan 19, 2022 at 12:18 PM John Kitchin wrote: > I am not sure this is quite what you are looking for. You could use a > macro like this. > > > > {{{r-stack(((src1 . fade-out) (src2 . fade-in) (src3 . fade-out)))}}} > > * code :noexport: > > #+macro: r-stack (eval (r-stack $1)) > > #+BEGIN_SRC emacs-lisp > (defun r-stack (src-alist) > "SRC-alist will be a string containing a list of (src . data-fragment) > src is a url or filename > data-fragment > > Returns a string for export." > (let ((src (read src-alist))) > (format "#+BEGIN_EXPORT html >
> %s >
> ,#+END_EXPORT" > (string-join > (cl-loop for (src . data-fragment) in src > collect > (format " " > data-fragment src)) > "\n")))) > > > (r-stack "((src1 . fade-out) (src2 . fade-in) (src3 . fade-out))") > #+END_SRC > > #+RESULTS: > : #+BEGIN_EXPORT html > :
> : > : > : > :
> : #+END_EXPORT > > You could also make a link do that. > Huh. This wasn't at all what I was thinking but it may be a much better way than I'd htought of. A link seems like it would be a great solution, especially if I could figure out how to get the :follow function to open an individual ~src~ path. Would you use "looking-at" to get the right candidate, or can you think of a way to get completion candidates for a function that opens the file? I'm looking at your eamples in https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9 but can't quite follow the code. Thank so mjch for this really interesting solution. > > John > > ----------------------------------- > Professor John Kitchin (he/him/his) > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > > > On Wed, Jan 19, 2022 at 9:42 AM Matt Price wrote: > >> I am trying ot figure out if I can create a simplified syntax for a >> particular special block in a derived HTML exporter. >> >> I'm trying to produce HTML like this: >> >>
>> >> The derived backend (org-re-reveal) already has an >> >> #+ATTR_REVEAL that an make the data-fragment attributes, so it's not hard to produce >> the desired outpu: >> >> #+begin_r-stack >> #+ATTR_REVEAL: :frag appear[[imglink1]] >> #+ATTR_REVEAL: :frag appear[[imglink2]]#+end_r-stack >> >> However, I'd really like to add a less verbose syntax, like this: >> >> #+begin_r-stack :frag (appear appear)[[imglink1]][[imglink2]]#+end_r-stack >> >> My question is: will the exporter preserve information from these header-like arguments, and is >> there a mechanism I can use in a custom ~special-block-function~ to make use of htem? >> >> Thanks for your help as always! >> >> Matt >> >> --0000000000007baf3d05d6050f72 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Jan 19, 2022 at 12:18 PM John= Kitchin <jkitchin@andrew.cmu= .edu> wrote:
I am not sure this is quite what you are looking = for. You could use a macro like this.=C2=A0


{{{r-stack(((src1 . fade-out) (src2 . fade-in) (src3 . fade-out)))}}}
=
* code :noexport:

#+macro: r-stack (eval (r-stack $1))

#+= BEGIN_SRC emacs-lisp
(defun r-stack (src-alist)
=C2=A0 "SRC-alis= t will be a string containing a list of (src . data-fragment)
src is a u= rl or filename
data-fragment

Returns a string for export." = =C2=A0
=C2=A0 (let ((src (read src-alist)))
=C2=A0 =C2=A0 (format &qu= ot;#+BEGIN_EXPORT html
<div class=3D\"r-stack\">
%s = =C2=A0 =C2=A0 =C2=A0
</div>
,#+END_EXPORT"
=C2=A0 = =C2=A0(string-join
=C2=A0 =C2=A0 (cl-loop for (src . data-fragment) in= src
=C2=A0 =C2=A0 =C2=A0collect
=C2=A0 =C2=A0 =C2=A0(format &q= uot; =C2=A0<img data-fragment=3D\"%s\" src=3D\"%s\"/= >"
=C2=A0 =C2=A0 =C2=A0data-fragment src))
=C2=A0 =C2= =A0 "\n"))))


(r-stack "((src1 . fade-out) (src2 .= fade-in) (src3 . fade-out))")
#+END_SRC

#+RESULTS:
: #+B= EGIN_EXPORT html
: <div class=3D"r-stack">
: =C2=A0 &= lt;img data-fragment=3D"fade-out" src=3D"src1"/>
= : =C2=A0 <img data-fragment=3D"fade-in" src=3D"src2"= />
: =C2=A0 <img data-fragment=3D"fade-out" src=3D"= src3"/> =C2=A0 =C2=A0 =C2=A0
: </div>
: #+END_EXPORT<= br>

You could also make a link do that.

Huh.=C2=A0 This wasn't at all what I = was thinking but it may be a much better way than I'd htought of.=C2=A0=

A link seems like it would be a great soluti= on, especially if I could figure out how to get the :follow function to ope= n an individual ~src~ path. Would you use "looking-at" to get the= right candidate, or can you think of a way to get completion candidates fo= r a function that opens the file? I'm looking at your eamples in https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-featur= es-in-org-9 but can't quite follow the code.

Thank so mjch for this really interesting solution.

=
John

--= ---------------------------------
Professor John Kitchin (he/him/his)Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mello= n University
Pittsburgh, PA 15213
412-268-7803
<= /div>

On Wed, Jan 19, 2022 at 9:42 AM Matt Price <moptop99@gmail.com> wrote:
<= /div>
I am trying ot figure out if I can create a simplified syntax for a parti= cular special block in a derived HTML exporter.=C2=A0

I'm trying to produce HTML like this:

<div class=3D"r-stack>
  <img data-fragment=3D"fade-ou=
t" src=3D"...."/>
  <img data-fragment=3D=
"fade-in" src=3D"..."<=
span>/>
</div>


The derived backend =
(org-re-reveal) already has an 
#+ATTR_REVEAL that an make the data-fr=
agment attributes, so it's not hard to produce
the desired outpu:
#+begin_r-stack
#+ATTR_REVEAL: :frag = appear [[imglink1]]
#+ATTR_REVEAL: :frag appear
[[imglink2]] #+end_r-stack

However, I'd really like to add a less verbose syntax, like t=
his:

#+begin_r-stack :frag (appear appear) [[imglink1]] [[imglink2]] #+end_r-stack
My question is: will the exporter preserve information from these hea=
der-like arguments, and is 
there a mechanism I can use in a custom ~spe= cial-block-function~ to make use of htem?

Thanks for your help as =
always!

Matt
--0000000000007baf3d05d6050f72--