Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support org-babel / org-export #36

Open
neuhalje opened this issue Feb 27, 2021 · 2 comments
Open

Support org-babel / org-export #36

neuhalje opened this issue Feb 27, 2021 · 2 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation org-mode

Comments

@neuhalje
Copy link

As someone who writes about technical topics, I'd like to use org-babel in my blog.

Examples

Table Generation

For example the following snippet is only exported as source block:

#+begin_src emacs-lisp :exports both
'((a b c) (d e f))
#+end_src

Whereas org-export correctly renders the results (output of org-org-export-as-org):

#+begin_src emacs-lisp
'((a b c) (d e f))
#+end_src

#+results: 
| a | b | c |
| d | e | f |

Using call

The following source block is rendered to This is a greeting: . (call is not executed):

#+NAME: greeting
#+begin_src emacs-lisp :exports results :results silent :var name=""
(format "Hello %s, nice to meet you" name)
#+end_src

This is a greeting: call_greeting(name="Emacs").

Whereas org-export correctly renders the results (output of org-org-export-as-org):

This is a greeting: =Hello Emacs, nice to meet you=.

Suggestion

Add a filter that can transform the source, e.g. via org-org-export-as-org.

Things to consider

Calling org-org-export-as-org on each source file during export could get very slow and/or have unexpected consequences (e.g. when the babel code touches the disk).

@mrmechko
Copy link
Contributor

I opened a PR (#35) to resolve #26 using org-org-export-as-org. Referencing here because the slowness and/or unexpected consequences you mention are not things I had been considering.

@clarete clarete added bug Something isn't working org-mode labels Mar 1, 2021
@clarete
Copy link
Collaborator

clarete commented Mar 3, 2021

Hi @neuhalje, thank you for opening this issue and for the clear test cases!

Mine didn't work until I added the entry (emacs-lisp . t) to org-babel-load-languages:

(org-babel-do-load-languages
   'org-babel-load-languages
   '((ditaa . t)
     (dot . t)
     (emacs-lisp . t)  ;; I did not have this guy here
     (gnuplot . t)
     (latex . t)
     (plantuml . t)
     (python . t)
     (ruby . t)))

Do you have that in your settings?

@clarete clarete added the documentation Improvements or additions to documentation label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation org-mode
Projects
None yet
Development

No branches or pull requests

3 participants