From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Exporting noweb-ref's without disabling org-babel processing Date: Tue, 22 Oct 2019 22:29:08 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a4366e059585a719" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45758) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iN0mR-00032x-42 for emacs-orgmode@gnu.org; Tue, 22 Oct 2019 16:29:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iN0mP-000857-Ph for emacs-orgmode@gnu.org; Tue, 22 Oct 2019 16:29:23 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:51186) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iN0mP-00084j-DH for emacs-orgmode@gnu.org; Tue, 22 Oct 2019 16:29:21 -0400 Received: by mail-wm1-x32e.google.com with SMTP id q13so8707756wmj.0 for ; Tue, 22 Oct 2019 13:29:20 -0700 (PDT) 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" To: Org-mode --000000000000a4366e059585a719 Content-Type: text/plain; charset="UTF-8" Hi, I'm working on a Leanpub Markua exporter (not quite complete yet but already usable, if you are interested: https://github.com/zzamboni/ox-leanpub/tree/book-and-markua) I would like to include the value of :noweb-ref for code blocks in exported output, like noweb originally did, e.g. something like this: #begin_src emacs_lisp :noweb-ref super-duper-code ... #end_src to produce something like this in the export: <>= ... After much poking around, I figured that the :noweb and :noweb-ref header args are removed by org-babel *before* the src block makes it to the exporter. I also discovered that by setting org-export-use-babel to nil I could disable this behavior, which means that my exporter can access the :noweb-ref argument by parsing the :parameters property (see https://github.com/zzamboni/ox-leanpub/blob/book-and-markua/ox-leanpub-markua.el#L388 ). This was good for my original purpose, but I just realized that this also disables other useful org-babel features on export, such as the processing of the :exports header argument, which means that both code and results are always included in the export regardless of what :exports says :) I have tried using org-babel-exp-code-template, but unfortunately if I try to use "%noweb-ref" as a key in its value, it gets replaced by the value of :noweb followed by "-ref" in every case. Is there some other way of accessing org-babel header arguments like :noweb-ref from the exporter, but without having to disable org-babel processing completely? Any other ideas for achieving what I want? Thanks for any ideas, --Diego --000000000000a4366e059585a719 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I'm working on a Leanpub Markua= exporter (not quite complete yet but already usable, if you are interested= :=C2=A0https://github.com/zzamboni/ox-leanpub/tree/book-and-markua)
<= div>
I would like to include the value of :noweb-ref for code= blocks in exported output, like noweb originally did, e.g. something like = this:

#begin_src emacs_lisp :noweb-ref super-duper= -code
...
#end_src

to produce = something like this in the export:

<<super-d= uper-code>>=3D
=C2=A0...

After muc= h poking around, I figured that the :noweb and :noweb-ref header args are r= emoved by org-babel *before* the src block makes it to the exporter. I also= discovered that by setting org-export-use-babel to nil I could disable thi= s behavior, which means that my exporter can access the :noweb-ref argument= by parsing the :parameters property (see=C2=A0https= ://github.com/zzamboni/ox-leanpub/blob/book-and-markua/ox-leanpub-markua.el= #L388).

This was good for my original purpose,= but I just realized that this also disables other useful org-babel feature= s on export, such as the processing of the :exports header argument, which = means that both code and results are always included in the export regardle= ss of what :exports says :)

I have tried using org= -babel-exp-code-template, but unfortunately if I try to use "%noweb-re= f" as a key in its value, it gets replaced by the value of :noweb foll= owed by "-ref" in every case.

Is there s= ome other way of accessing org-babel header arguments like :noweb-ref from = the exporter, but without having to disable org-babel processing completely= ? Any other ideas for achieving what I want?

Thank= s for any ideas,
--Diego

--000000000000a4366e059585a719--