[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

custom function for org-babel src block export

From: David Bremner
Subject: custom function for org-babel src block export
Date: Mon, 25 Dec 2023 13:49:34 -0800

I am generating slides using org-beamer. I would like certain code
blocks to export as links containing URL-encoded content of the
block. As an example I would like the following block 

#+begin_src stacker 
(defvar x 1)
(deffun (f)
  (defvar y 2)
  (deffun (h)
    (+ x y))

would be exported as something like

 on stacker}

I can do the encoding easily enough (see end), but I did not see a way
of hooking that up to org-babel, while retaining the ability to also use
minted or listings for other blocks.

I need the ability to use noweb expansion, so using a custom block type
seems unattractive (at least at first glance).

(defvar stacker-base
"\href{https://www.example.com/stacker/?program=%}{execute on stacker}")

(defun db-stacker-link (prog)
  (format stacker-base 
          (org-link-encode prog '(?? ?  ?( ?) ?\n))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]