Matt Price <mopto...@gmail.com> writes:

> The real problem I have is that, when exporting a subtree, I want to set
> org-md-toplevel-hlevel to "2" and add the title; when exporting a whole
> file, I want to set org-md-toplevel-hlevel to "1" and ignore the title.

You can examine :export-options value in the INFO plist.
The value is a list with up to 3 elements: 'subtree, 'visible-only, and
'body-only.

In your backend :filters-alist, you can define a :filter-options filter
that will set :md-toplevel-hlevel option as needed, before the export
starts.

The :filter-options filter is there to pre-process export options
programatically, just as you describe.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to