See raw source for details of settings on each block and file properties
Simple operation:
(+ 1 2)
With :exports both
present to the source block, if the #+RESULTS:
is missing in the org file, no results exported! (makes sense I think)
Another test, now with :exports both
added to the source block AND executed with C-c-c
:
(current-time-string)
Fri Jun 30 10:16:03 2017
I understand that :exports both
is important to export results if present in the org file.
We can see that emacs-lip source blocks obey to #+PROPERTY: header-args :eval never-export
.
Their results are exported but NOT executed during export.
Next, let’s try the SQL blocks (next section).
List of tables:
show tables;
Tables_in_test |
---|
text_test |
With no other parameters to the source block, the block is not executed during export BUT results are not exported.
Now with :exports both
to the source block:
select now();
now() |
---|
2017-06-30 10:25:22 |
We can see that unlike the E-lisp source blocks, the results are parsed THEN exported.
(they did not appear/replace in the buffer as #+RESULTS:
data)
The results in the org buffer is different from the one exported in HTML!
I learned that properties are inherited, and the properties drawer where overriding the global #+PROPERTY
at the top.
But since properties can be local to “source type”, I simply fixed my properties drawer buy making it look like:
:header-args:sql: :engine mysql :dbhost localhost :dbuser root :database test :cmdline --protocol=tcp
Now, my block is not evaluated during export, the computed result in the file is simply exported.
select now();
now() |
---|
2017-06-30 10:25:22 |
TIL: Property inheritance is a real thing, important to understand when making more complex document.