Skip to content

SRC block exported even if :exports results is set #99

Open
@doolio

Description

@doolio

I have the following note with three fields (code, output and remarks) where I attempt to leverage org-babel to produce the output from specific code snippets and have that output below the next sub-heading and therefore appear on the back of the card. To achieve this I do not evaluate (via C-c C-c) the src block on the front (field = code) of the card but instead evaluate the one on the back (field = output) of the card. The second src block calls the first (tuple-unpacking) src block and simply prints the result. This is what I want. However, the issue is the second src block is exported when I push to Anki despite the header parameter :exports specifying results and not the default code. This is not what I would expect. Is this a bug in anki-editor or ox.el i.e. org-export.

* Tuple Unpacking
:PROPERTIES:
:ANKI_DECK: PKB
:ANKI_NOTE_TYPE: Code Output
:ANKI_TAGS: python
:ANKI_NOTE_ID: 1651139569279
:END:
** Code

#+name:tuple-unpacking
#+begin_src python :results output raw
*a, b, c = (1, 2, 3, 4, 5)
print(a, b, c)
#+end_src

** Output

#+begin_src shell :var REPL=tuple-unpacking :results output raw :exports results
echo $REPL
#+end_src

#+RESULTS:
[1, 2, 3] 4 5

** Remarks
Tuple unpacking

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions