I've recently decided to give org-mode and org-babel a shot as a notebook (think jupyter). I have a cli program that takes two text files as input. Currently, I've put those text files in a `#+begin_src text` block, with a tangle. I then have a `#+begin_src sh` block taking two filenames as input variables that invoke the cli program with the filenames.
The current workflow thus ends up being:
1. don't forget to tangle the input files
2. invoke the shell block
Ideally I'd like to somehow configure it such that invoking the shell block will auto-tangle the input blocks, or something to that effect (if there's an option to put them in a temp file and present the filename to the `sh` block, that's also fine). Is this something that can be done somewhat straightforwardly?
Secondly, currently I have the following tangle instructions on each input file:
`:tangle (org-in-tangle-dir "file.txt")`. The filename to tangle to is identical to the `#+name: file.txt` preceding the block. The `org-in-tangle-dir` function is defined as follows:
(defun org-in-tangle-dir (sub-path)
"Expand the SUB-PATH into the directory given by the tangle-dir
property if that property exists, else use the
`default-directory'."
(expand-file-name sub-path
(or
(org-entry-get (point) "tangle-dir" 'inherit)
(default-directory))))
Is there any way to tell the tangle to use the `#+name` attribute as filename to tangle to?
Thanks for any help