Question

I have an org doc that contains:

#+BEGIN_SRC org
  ,#+BEGIN_SRC sh
  curl -XPOST 'localhost:9200/thing/doc/1' -d'{"body": "foo"}'
  curl -XPOST 'localhost:9200/thing/doc/2' -d'{"body": "bar"}'
  <<refresh>>
  ,#+END_SRC
#+END_SRC

And I'd like to actually ignore the <<refresh>> so it exports correctly as the actual text <<refresh>> when I export HTML (this is for an article demonstrating org-babel and noweb). Instead, it's exporting as a blank space, how can I get it to export verbatim?

Was it helpful?

Solution

If you want noweb syntax disabled for exporting, but enabled for tangling you can use :noweb no-export

#+BEGIN_SRC org :noweb no-export
  ,#+BEGIN_SRC sh
  curl -XPOST 'localhost:9200/thing/doc/1' -d'{"body": "foo"}'
  curl -XPOST 'localhost:9200/thing/doc/2' -d'{"body": "bar"}'
  <<refresh>>
  ,#+END_SRC
#+END_SRC

See http://orgmode.org/manual/noweb.html#noweb

OTHER TIPS

This is the output of exporting HTML in my Emacs 24.3.1 (Org mode 8.1.1):

#+BEGIN_SRC sh
curl -XPOST 'localhost:9200/thing/doc/1' -d'{"body": "foo"}'
curl -XPOST 'localhost:9200/thing/doc/2' -d'{"body": "bar"}'
<<refresh>>
#+END_SRC

There is no blank space, <<refresh>> is exporting verbatim. That is your version of org-mode?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top