Hello, Jonathan Leech-Pepin <jonathan.leechpe...@gmail.com> writes:
> Over the last few days I've been working on implementing an Org -> > Texinfo exporter based on the new e-latex exporter. Argh. While your idea is nice, starting from `e-latex' exporter is almost certainly a bad move. Indeed, it is a quite convoluted back-end which may not help to understand how the generic exporter can be used. At some point I will have to write a tutorial on how to start a back-end from scratch... > It is not yet able to generate all the expected contents for export > towards an Info file, however it does create enough to successfully > export and read through Info. You may want to get in touch with François Pinard (CC'ed), who had started a similar project a few weeks ago. > - There is no provision for indices, limiting usefulness in > cross-referencing. Org export has some tools to handle cross-referencing even when the back-end doesn't (ASCII exporter has it). > - There is no #+attr_texinfo or #+TEXINFO: for arbitrary snippets or > for passing features to tables/blocks. I'm not sure exactly how to > hook these in and would need a pointer in the right direction to do > so. If you add #+ATTR_TEXINFO above an element, you can access its contents with (org-element-property :attr_texinfo element). Ideally parameters should be passed as a plist. I.e. --8<---------------cut here---------------start------------->8--- #+ATTR_TEXINFO: :width 5 :key "some value" Some element --8<---------------cut here---------------end--------------->8--- In that case, you can use `org-export-read-attribute' to parse :attr_texinfo. I.e. (org-export-read-attribute :attr_texinfo element) will return '(:width 5 :key "some value") You can then pick the property you want with `plist-get'... Seeing this, I think I should add an optional argument to directly access a given property. I.e. (org-export-read-attribute :attr_texinfo element :width) => 5 #+TEXINFO: keywords are automatically recognized as keywords. There is nothing special to do. I.e. (defun org-e-texinfo-keyword (keyword contents info) (let ((key (org-element-property :key keyword)) (value (org-element-property :value keyword))) (cond ... ((equal key "TEXINFO") value) ; Return value as-is ...))) Though, if you want to add support for #+BEGIN_TEXINFO/#+END_TEXINFO blocks, you will have to add: (add-to-list 'org-element-block-name-alist '("TEXINFO" . org-element-export-block-parser)) > - The largest issue perhaps: There is no method to create @kbd{} and > @key{} commands on export. If anyone has any suggestions how these > might be achieved (perhaps looking for a prefix in =code=?) I would > greatly appreciate it. You can probably use export-snippets: An important key: @@e-info:@kbd{C-c C-c}@@. > There are a few limitations to what will successfully be exported: > - Headlines cannot contain any of the following symbols: periods, > commas, colons or parentheses. This is a limitation of texinfo and > will result in errors when running makeinfo. Semi-colons will > export however. Can't you protect these chars? Regards, -- Nicolas Goaziou