From: David Bremner <david@tethera.net>
To: emacs-orgmode@gnu.org
Subject: Re: custom function for org-babel src block export
Date: Mon, 25 Dec 2023 22:31:24 -0800 [thread overview]
Message-ID: <87h6k5h3ur.fsf@tethera.net> (raw)
In-Reply-To: <87jzp1hf6i.fsf@tethera.net>
David Bremner <david@tethera.net> writes:
> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> David Bremner <david@tethera.net> writes:
>>
>>> I am generating slides using org-beamer. I would like certain code
>>> blocks to export as links containing URL-encoded content of the
>>> block.
>>
>> Check out https://orgmode.org/manual/Advanced-Export-Configuration.html
>> You may use export filter or extend ox-beamer backend, creating a new
>> custom backend that will export your code blocks as desired.
>>
>
> Thanks for the suggestion(s).
>
> I tried defining org-export-filter-src-block-functions (see end)
> but I encountered two issues
>
My "good enough for now" solution is to use a second emacs-lisp code
block as below. This requires a bit of care to keep the link in sync
with the exported code, but is otherwise workable.
#+name: smol-test
#+begin_src smol
(deffun (f x) (+ x 1))
#+end_src
#+begin_src emacs-lisp :eval true :exports results :noweb yes :results value latex
(db-stacker-link "<<smol-test>>")
#+end_src
#+results:
#+begin_export latex
\href{https://www.example.com/stacker/?program=%28deffun%20%28f%20x%29%20%28+%20x%201%29%29}{execute on stacker}
#+end_export
next prev parent reply other threads:[~2023-12-26 6:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-25 21:49 custom function for org-babel src block export David Bremner
2023-12-25 21:57 ` Ihor Radchenko
2023-12-26 2:26 ` David Bremner
2023-12-26 6:31 ` David Bremner [this message]
2023-12-26 13:12 ` Rudolf Adamkovič
2023-12-26 14:36 ` David Bremner
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=87h6k5h3ur.fsf@tethera.net \
--to=david@tethera.net \
--cc=emacs-orgmode@gnu.org \
/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).