Juan Manuel Macías <maciasch...@posteo.net> writes: > Going back to the earlier :ATTR_BACKEND: issue as a property for > headings, I've been doing some testing and scribbled down a possible > function[1] whose code is almost entirely stolen from > org-export-read-attribute, with some modifications. Evaluated at the > headline, it returns the value of the ATTR_BACKEND property as a plist. > And then that plist could be easily manipulated on each backend to > format export_template conveniently. For example: > > * headline > :PROPERTIES: > :ATTR_LaTeX: :export_template \begin{myenv}\n%s\n\end{myenv} > :ATTR_LaTeX+: blah blah blah > :END: > > ==> (:export_template "\\begin{myenv}\\n%s\\n\\end{myenv} blah blah blah") > > I don't know if that would be the way to go...
What I have in mind is to modify `org-export-read-attribute' directly. Then, we can call `org-export-read-attribute' in `org-export-data'; resolve the refs in the template (re-use code from `org-babel-ref-resolve' and `org-babel-parse-multiple-vars'); do normal export and pass it to the template. Before running the normal export, we strip :export_template from the INFO to avoid issues with ox-html which puts every single attr into the generated html. -- Ihor Radchenko, 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