[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: custom function for org-babel src block export
From: |
David Bremner |
Subject: |
Re: custom function for org-babel src block export |
Date: |
Mon, 25 Dec 2023 22:31:24 -0800 |
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