Kungsgeten / org-brain

Org-mode wiki + concept-mapping
MIT License
1.73k stars 104 forks source link

Run org-babel stuff during visualisation? #293

Open spacekitteh opened 4 years ago

spacekitteh commented 4 years ago

So, I have the following in my index.org:

#+name: my-pkb-version
#+begin_src shell :exports none :results value verbatim 
git describe --always
#+end_src

This is version  call_my-pkb-version() of my personal knowledge-base.

When visualising, it doesn't process the org-babel call. How can I get it to do this?

Kungsgeten commented 4 years ago

I'm not sure the following will work in all cases, but you could try it:

(add-hook 'org-brain-visualize-text-hook 'org-babel-execute-buffer)

The code blocks will now be executed inside the org-brain-visualize buffer, meaning that the content of the original file will not be modified.

spacekitteh commented 4 years ago

That didn't work, unfortunately!

Kungsgeten commented 4 years ago

Did anything happen at all? When I tried it (but not exactly with your example) I got a result block in the org-brain-visualize buffer. On the other hand I haven't used org-babel very much so I'm not quite sure what the parameters you give to source block does.

spacekitteh commented 4 years ago

Nope, nothing happened at all :(