Today I want to try out org-mode’s tangle feature, and my requirement is as follows.
I have a go.traps.org
file, and I want to organize the Go problems I’ve encountered there. Each code block will be tangled from a file in another project, say ~/projects/learn/go/trap/*.go
. But it’s too troublesome to define the following header-args for each code snippet:
:tangle ~/projects/learn/go/trap/trap-tangle-file-name.go
So I want to use properties to solve this. At the file level, I’ve defined the following global property:
:PROPERTIES:
:export-dir: ~/projects/learn/go/trap/
:header-args:go: :tangle ??
:END:
The ?? above is the problem I’m trying to solve. My goal is that the value of ?? should be the concatenation of :export-dir:
and the current heading’s title or code block’s :NAME:
value. How can I achieve this? Or is there a more idiomatic way to do this?