I want to be able to create a function that splits or exports only top headlines starting with *
in a org mode file (recursively) into a separate file.
* Title_of_Heading_1
Text 1
** Sub-Heading 2
Text 2
* Title of Heading 2
Text 3
** Sub-Heading 22
Text 2
*** Sub-Heading 33
Text 2
would result in the files splitting only Title of Heading 1
and Title of Heading 2
, note that in the filename white space is replaced with _
. Splitted files:
=> Title_of_Heading_1.md, which will contain `Title_of_Heading_1` and `Sub-Heading 2`
=> Title_for_Heading_2.md, which will contain `Title of Heading 2`, `Sub-Heading 22` and `Sub-Heading 33`
Related: split every single org headline in a org file to separate md/org files
C-c C-e
and in the export dispatcher, doC-s
to toggle thebuffer/subtree
setting before you specify the backend and destination.org-element-map
to do the headline hopping dance and have it call the function on each headline of interest.