From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sB+sH2XT6WG0/gAAgWs5BA (envelope-from ) for ; Thu, 20 Jan 2022 22:25:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YLpyGGXT6WGQXgEAG6o9tA (envelope-from ) for ; Thu, 20 Jan 2022 22:25:57 +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 0722710537 for ; Thu, 20 Jan 2022 22:25:57 +0100 (CET) Received: from localhost ([::1]:50082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAewM-0001GR-As for larch@yhetil.org; Thu, 20 Jan 2022 16:25:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAa2v-0002Uc-8V for emacs-orgmode@gnu.org; Thu, 20 Jan 2022 11:12:21 -0500 Received: from [2a00:1450:4864:20::334] (port=39871 helo=mail-wm1-x334.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAa2o-0004P7-Rf for emacs-orgmode@gnu.org; Thu, 20 Jan 2022 11:12:20 -0500 Received: by mail-wm1-x334.google.com with SMTP id o1-20020a1c4d01000000b0034d95625e1fso8544911wmh.4 for ; Thu, 20 Jan 2022 08:12:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew.cmu.edu; s=google-2021; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1GUnSZRFJS24Jf4NEGQMmZrkD/bHlFocFWaMX4TIv0Q=; b=YM7Gxe1fTv1VFF3yKFQWqrRA5Vb4XMsJFhIzLvXZ69ye0v/PM6rF8ZuWUEoFPMIK4r QuyMqczot/RkbJHUvKuyYm6GE4Gy61Znxy5Fsa95ACcmwwLRcfVj4g2Zl4y/ejytll/L ZwqU7EWid8DvvEMmXj0PXmDBUa+eaIzmPh4Xo50/ksiA0Dj6vnQVYdayErToVjF2xGot pkg86mnVlYYOkGHcQoc6kb/LUgBOe7hY/bFDM/Xy6p2G7wyHfMT51vOtQPAMtNbGH8Cm 5/AMGwxPoMrCpcHakp95bVAX5pQwo1FWlAolAn1h4xLvlcV7YEsyvlfZX4QRtABtatKK tiPw== 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=1GUnSZRFJS24Jf4NEGQMmZrkD/bHlFocFWaMX4TIv0Q=; b=TXywcmXdw17fiuUJVG4qxXLC95U4sv7FDzCBnnkHwj3weehH88wxcsZ/02qRYcJRaL G2JkP795KLEjyZZsyA6rJ8H8Zm5AWIE/iNdjFG3thiGAUm6uKl+RS9A7COvGpPuZ5MPk npGnJsXTDqadAWZ6aHDWTLNw+FwV6T9u8TMd2CPqgZ9rR1VjDOAV6RLq9Y/yD7ivoyVH iS/VI6s/nTm2XvyQBptK/RCOoDR6aumGhh0+Id+HmJocsmgZLi6I/MzNBTWOa8BVvwwp kQco7MBaIjhZ6EKM5ksp/vF/CaxCdCmfVHPYJXIRVeVTqg9TPU43yXkS2Yclmd1CH6d9 DP5w== X-Gm-Message-State: AOAM5315+SV9g1MuvxHxiy0hCyUk6oyvTphwlavZcNY0oq2zW7vIkuAN l9uPTYDkSSdeGM+yDAEb8hE6sPO8xY4a4Nv8PWE= X-Google-Smtp-Source: ABdhPJzoHIV2rd/Brc56oYbZ2wlSMZoBfsK7xPCe3TgVZMK7jEdxcGcM1oN+VP+7ZQQ62Kmvm9woFXlw4aZutL3xWFo= X-Received: by 2002:a5d:644a:: with SMTP id d10mr3675779wrw.295.1642695132071; Thu, 20 Jan 2022 08:12:12 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: John Kitchin Date: Thu, 20 Jan 2022 11:12:01 -0500 Message-ID: Subject: Re: handling as special special block in derived export To: Matt Price Content-Type: multipart/alternative; boundary="000000000000d249d705d605c3b2" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::334 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=johnrkitchin@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: 13 X-Spam_score: 1.3 X-Spam_bar: + X-Spam_report: (1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, 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=1642713957; 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=1GUnSZRFJS24Jf4NEGQMmZrkD/bHlFocFWaMX4TIv0Q=; b=keStdoW/83RLZw7STewxeDUUu5ZwkeFImYU0lhWjsu291RzPhoeytQT5TYXdS9CQeFqckR tEI7UgXNs8jA6ZKCeC3hGvyRjGAPYQWI7WuoCtH6a1OEmwYqTJ95ibdMsD6TPHg9iTwXkw 0phpqDHWIdSTJ4nt3GwX5WCKzLCbyp4kAJz6Y5FvjKvGDA26ToHx1LQOjl6knFmjoMEwcq nPNSqbVOu8JVlBcTTLYYfDRlfYEb8ii5ANtC0rKO0y/Dj91mL0tV4R01/InPg3wY0x5bHX fIrMWONyjho0LfG4skOvpvQElu1fiZvu5O2Dk02RfCq9LvIvwZ8tWj9VIOvI/g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642713957; a=rsa-sha256; cv=none; b=sU7BUmhoMjZG8dCHa8aJTpX8vclOWVeCKsxHfw5GDf34Iki4zXIs95Orei+2I5E28YK4Cd sJ79hWWgmvpR7LPQtbdwfF8lPfAbYKriD/lO+kc9mZ1ae3p2U+biA8WkxnQu/3P2pqvZTB EQ4pHpxiAxTp9QnlfizxCedgKHqQ56HJfWRoXL1ddW1z6KX5Z0+gnPi9Pe9ajtypdQFkBQ eF+bvYlqx0TEDhULEh2VKT+hLjavsC2xddD0pzXm8yi0zepfpyZbneIeirUSLSQkhOg21M ugO3FzJV2IUlTWq5i92ARBHKuTU5MYMlJJh/nnF4tAZhc/RIhk72gnPjWyvZUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=YM7Gxe1f; dmarc=pass (policy=none) header.from=andrew.cmu.edu; 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.32 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=YM7Gxe1f; dmarc=pass (policy=none) header.from=andrew.cmu.edu; 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: 0722710537 X-Spam-Score: -5.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: +XVhCfq8F51T --000000000000d249d705d605c3b2 Content-Type: text/plain; charset="UTF-8" It depends on what the src things look like. You might be able to just call ffap or some variant of it. Here is an example of the follow part that works for a file and url for me. #+BEGIN_SRC emacs-lisp (org-link-set-parameters "rstack" :follow (lambda (path) (ffap (or (ffap-url-at-point) (ffap-file-at-point))))) #+END_SRC #+RESULTS: | :follow | (lambda (path) (ffap (or (ffap-url-at-point) (ffap-file-at-point)))) | [[rstack:(("./screenshots/date-20-01-2022-time-10-36-54.png" . fade-out) (src2 . fade-in) ("https://google.com" . fade-out))]] 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 Thu, Jan 20, 2022 at 10:21 AM Matt Price wrote: > > > 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 >>> >>> --000000000000d249d705d605c3b2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It depends on what the src things look like. You might be = able to just call ffap or some variant of it. Here is an example of the fol= low part that works for a file and url for me.

#+BEGIN_S= RC emacs-lisp
(org-link-set-parameters
=C2=A0"rstack"
= =C2=A0:follow (lambda (path)
=C2=A0 (ffap (or (ffap-url-at-point)
= =C2=A0 =C2=A0 (ffap-file-at-point)))))
#+END_SRC

#+RESULTS:
= | :follow | (lambda (path) (ffap (or (ffap-url-at-point) (ffap-file-at-poin= t)))) |


[[rstack:(("./screenshots/date-20-01-2022-time-10-3= 6-54.png" . fade-out) (src2 . fade-in) ("https://google.com" . fade-out))]]


John

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


On Thu, Jan 20, 2022 at 10:21 AM Matt Price <moptop99@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">



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


=
Thank so mjch for this really interesting solution.

John<= br>
-----------------------------------
Professor John Kitchin (he/hi= m/his)
Doherty Hall A207F
Department of Chemical Engineering
Carne= gie Mellon University
Pittsburgh, PA 15213
412-268-7803


On Wed, Jan 19, 2022 at 9:42 AM Matt Price <moptop99@gmail.com> wr= ote:
I am trying ot figure out if I can create a simplified syntax fo= r a particular special block in a derived HTML exporter.=C2=A0

I'm trying to produce HTML like this:

<= /div>
<div class=3D"r-stack>
  <img data-fragment=
=3D"fade-out" src=3D"...."/>
  <img da=
ta-fragment=3D"fade-in" src=3D"..."/>
</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-stac= k :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
--000000000000d249d705d605c3b2--