From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Export to Texinfo Date: Fri, 20 Jul 2012 11:32:58 +0200 Message-ID: <87y5meaib9.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ss9dO-0000xp-Cs for emacs-orgmode@gnu.org; Fri, 20 Jul 2012 05:36:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ss9dM-0004od-PG for emacs-orgmode@gnu.org; Fri, 20 Jul 2012 05:36:30 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:63331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ss9dM-0004oH-Je for emacs-orgmode@gnu.org; Fri, 20 Jul 2012 05:36:28 -0400 Received: by wgbez12 with SMTP id ez12so2636012wgb.30 for ; Fri, 20 Jul 2012 02:36:27 -0700 (PDT) In-Reply-To: (Jonathan Leech-Pepin's message of "Thu, 19 Jul 2012 20:29:00 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jonathan Leech-Pepin Cc: =?utf-8?Q?Fran=C3=A7ois?= Pinard , Org Mode Mailing List Hello, Jonathan Leech-Pepin 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=C3=A7ois 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) =3D> 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 =3Dcode=3D?) 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, --=20 Nicolas Goaziou