[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Preventing noweb substitution during export
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Preventing noweb substitution during export |
Date: |
Thu, 28 Dec 2017 12:42:51 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hello,
address@hidden (Samuel W. Flint) writes:
> Nicolas, my apologies for sending this twice.
>>>>>> Nicolas Goaziou writes:
>
> NG> Hello, address@hidden (Samuel W. Flint) writes:
>
> >> I used to be able to prevent noweb substitution during export by
> >> setting noweb to tangle, now it's only a yes/no option. When was
> >> this feature removed, and what can I do to get it back?
>
> NG> I don't think that was intended. Would you have an ECM
> NG> demonstrating the issue?
>
> It didn't get removed, though no-export is now the correct value.
> Neither, however, are currently documented in the manual.
Patches welcome! Org manual is now an Org file, it should be much more
pleasant to edit. :)
> And the following should demonstrate how they currently behave:
>
> #+BEGIN_EXAMPLE
> #+PROPERTY: :noweb tangle
This should be:
#+property: header-args :noweb tangle
> #+name: a
> #+begin_src python
> def foo():
> print "foo"
> #+end_src
>
> #+name: b
> #+begin_src python
>
>
> <<a>>
>
> foo() #+end_src
>
> #+name: c
> #+begin_src python :tangle "test.py"
>
> import bar
> <<b>>
> #+end_src
> #+END_EXAMPLE
>
> The file 'test.py' will contain:
>
> import bar
> <<a>>
>
> foo()
>
> If noweb is set to no-export, the <<a>> will be resolved. However, with
> tangle, the block is included during export.
I cannot reproduce it. The following document:
--8<---------------cut here---------------start------------->8---
#+PROPERTY: header-args :noweb tangle
#+name: a
#+begin_src python
def foo():
print "foo"
#+end_src
#+name: b
#+begin_src python
<<a>>
foo()
#+end_src
#+name: c
#+begin_src python :tangle "test.py"
import bar
<<b>>
#+end_src
--8<---------------cut here---------------end--------------->8---
becomes
--8<---------------cut here---------------start------------->8---
┌────
│ def foo():
│ print "foo"
└────
┌────
│
│
│ <<a>>
│
│ foo()
└────
┌────
│
│ import bar
│ <<b>>
└────
--8<---------------cut here---------------end--------------->8---
when exported to UTF-8.
Regards,
--
Nicolas Goaziou