I would like to have a link that runs a Babel source-code block. Does Org-mode support running something from the library of babel in a link, or a source block via a file+blockname reference? A Hyperbole button would also be acceptable.
You can easily define your own link type that runs source blocks:
(org-link-set-parameters "run" :follow #'org-babel-ref-resolve)
Afterwards a click on
run:hello executes the source block in the following Orgmode file.
#+name: hello #+begin_src emacs-lisp :var n=1 (message "Hello. n=%s" n) #+end_src #+RESULTS: hello : Hello run:hello [[run:hello(n=2)]]
The usual way to do this is like this:
#+name: mysum #+BEGIN_SRC emacs-lisp (+ 5 5) #+END_SRC #+call: mysum() #+RESULTS: : 10
I am not sure what the point of doing this in a link would be, where would the results go for example?
You can make a link like this: [[elisp:(progn (org-babel-goto-named-src-block "mysum") (org-babel-execute-src-block-maybe))]]
which will jump to that block and run it.