1

I'd like to specify a heading (using either link or agenda syntax) and export just that heading as a file, using elisp.

I'm not trying to do this - since this specifies the file to export to in the file itself: How to export top-level headings of org-mode buffer to separate files?

I think it might involve specific input to org-export-as? (a function in ox.el)

avv
  • 1,563
  • 10
  • 24
  • Maybe a combination of `org-link-search` with `org-narrow-to-subtree`? I think, by default, Org will export the narrowed buffer rather than the entire document. – wvxvw Jul 20 '15 at 05:49
  • That helped a bit, and I discovered `save-excursion` which helps not mess up document state as I do things (I'm relatively new to elisp). This is a step in the right direction: `(save-excursion (org-link-search link-string) (org-html-export-to-html nil t nil '())`. However, it doesn't for example make the title the selected heading, or keep normal export options, even if I replace `'()` with a call to `org-export-get-environment`. – avv Jul 21 '15 at 00:13

0 Answers0