1

Normally, when I use orgmode's export function on a buffer that contains noweb references, they get expanded, resulting in lots of duplicated code throughout the exported HTML document.

Is there a way to export an orgmode buffer without expanding noweb references, so they still show up as <<reference>> in the exported document?

1 Answer 1

2

To export a buffer without expanding noweb references, you can set the following at your src header, as per documentation:

#+begin_src language :noweb no-export

To define that globally, you can add the following at the top of your Org File:

#+property: header-args :noweb no-export

Or language specific:

#+property: header-args:languagename  :noweb no-export
8
  • It seems that adding this property to anything except the specific begin_src block fails when there is already a :noweb yes added to it. It also seems that only either :noweb no-export or :noweb yes can be set, not both... Commented Nov 26, 2018 at 17:43
  • 1
    What I left out: I tried just adding #+property: header-args :noweb no-export, but that resulted in org-babel-tangle not expanding them either, despite the documentation saying otherwise. Commented Nov 26, 2018 at 17:49
  • @DanielZiltener Yes, properties on the top of the file will be overwritten by properties at the block level. Blocks inherit parent properties, but can override them. In fact, the header args can be used for any argument, not only :noweb.
    – Daniel
    Commented Nov 26, 2018 at 18:11
  • If the documentation says something that does not correspond to the behaviour you experience, and if that functionality is important to you, I'd suggest creating a minimum example and opening an issue at the mailing list.
    – Daniel
    Commented Nov 26, 2018 at 18:14
  • Thing is, even when there's no :noweb property at block level, the global property has no effect. On block level, it works though. Commented Nov 26, 2018 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.