Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 1.29 KB

dynamicblocks.org

File metadata and controls

33 lines (26 loc) · 1.29 KB

Dynamic Blocks

While #+BEGIN_SRC blocks ARE arbitrary code they are not generic dynamic blocks!

In emacs you would just write some lisp, literally anywhere… import the function and then just use it in the dynamic block:

#+BEGIN: my-function :param1 value :param2 value
#+END:

The backend will call your method and replace looking it up by a naming convention, call it, and insert the text it returns into the dynamic block. This can be powerful for things that want to shell out (ledger based budgets) or for built in functionality like clocktable that dynamically generate report based on your org files.

To facilitate this, if you create a Packages/User/orgdynamic folder and place a named python file in there my-function.py for example you can call a method named:

def Execute(view, params):
	return "Some text to insert into the block"

This will insert the text directly into the block once evaluated with the: OrgExecDynamicBlock run while the cursor is over the heading of the block.

Source Blocks (BABEL)

  • Comment on how regular source blocks are executable.
  • Comment about how we don’t have the chaining features (tables and other source blocks can act as input to others) YET.