Orm Finnendahl <orm.finnend...@selma.hfmdk-frankfurt.de> writes:

>> I do not feel like :multipage-split-function is supposed to be export
>> _option_. It is more internal. That's why :translate-alist, where the
>> internals like templates and transcoders lie.
>
> That's how I had it before, but I reasoned it is not a transcoding
> function either, so I was unsure. Anyway I reversed it.

Thanks!

>> This is not a transcoder's job to export its contents.
>> Please move special handling of org-page AST nodes to `org-export-data'.
>
> done.

> +                 ((and (eq (org-element-type data) 'org-data)
> +                       (plist-get info :multipage))
> +                  (mapcar (lambda (org-page)
> +                            (org-export-data org-page info))
> +                          (org-element-contents data)))
> +                 ;; Element/Object with contents.

I am looking at this, and it feels like a wrong direction to go,
especially if we want to generalize multi-file export to non-pages as
well (e.g. formula exported as mathml file and as a link inside actual
exported .odt file).

Let's try to do it differently:

1. Introduce a new INFO plist field :multipage-pages - a list of extra
   pages to be exported in addition to the main document
2. Transocders can populate the list as needed, in addition to their
   normal return value, which may be a link to the page, for example
3. "pages" in the list, can be constructed using
   `org-export-with-backend' or other usual means to export data.
4. org-export-as will process all the pages from :multipage-pages in
   addition to the one returned by `org-export-data'.

I believe that this approach should be the least breaking and the most flexible.

WDYT?   

>>     >        (info (cl-list* ;; add :tl-headline and :tl-headline-number to 
>> info
>>     >               :tl-headline headline
>>     >               :tl-headline-number
>>     >               (alist-get
>>     >                headline
>>     >                (plist-get info :headline-numbering))
>>     >               info))
>> 
>> May you please explain what is the purpose of constructing custom INFO
>> plist, what all these parameters do, and why you re-do the export again
>> in the transcoder discarding the CONTENTS argument provided?
>> ...
> :tl-headline and :tl-headline-numbering are needed for constructing
> the side toc and the footnote section on each page. They are needed in
> org-html-multipage-toc, called by org-html-multipage-template and in
> org-html-footnote-section called from
> org-html-multipage-inner-template. At that stage there is no
> information about the page, the templates are on. Let me know if you
> have a better idea how to provide/access that information, I found a
> temporary addition to info the most natural way. As it will be needed
> by any multipage backend which wants to determine the footnotes for a
> page, I think there should be a generic solution in ox.el.
>
> As :tl-headline-numbering can be determined from the tl-headline
> within org-html-multipage-toc, I can get rid of that if you
> prefer. Let me know how to proceed.

With my idea above, we handle the actual page rendering to a custom
backend, which can reuse the normal TOC machinery, possibly encapsulated
into sub-backend parameters. We can provide any additional info that is
necessary within such sub-backend.

Do note that we should not assume that each page corresponds to a
headline in ox.el. It may be anything.

-- 
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