On 2023-06-03, at 07:08, Ihor Radchenko <yanta...@posteo.net> wrote:
> Marcin Borkowski <mb...@mbork.pl> writes: > >> On 2023-05-30, at 20:45, Marcin Borkowski <mb...@mbork.pl> wrote: >> >>>> Just use `org-export-as'. >>> >>> Thanks again, I didn't know about that function! >> >> I tried playing around with it, but it has one drawback - I can't use it >> to export a subtree containing a link to another subtree, and that is >> something I will definitely need. (I can see why it works that way - >> for that to work, I have to somehow make sure that subtrees containing >> targets of those links are also exported at some point in time - but >> I need another behavior...) > > AFAIR, ox-hugo implements what you want here. I know, but after a long consideration and some experiments I decided against Hugo - I want something (even) simpler and I plan to cook myself a pure Elisp solution. >> My current idea is to go with a custom exporter derived from the HTML >> one, indeed. Is there a better approach? > > You can loop over links in the exported subtree and export any extra if > necessary. For example, in the `org-export-filter-parse-tree-functions'. Interesting. The main problem with it is that the docstring is rather concise and I don't understand it well enough to use it. I will perform some experiments, but if they fail, I think a derived exporter with a custom link-exporting function can also be helpful. Thanks, -- Marcin Borkowski http://mbork.pl