emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel]Skip comments on code blocks on export?
@ 2012-01-25  9:14 Rainer M Krug
  2012-01-27 22:46 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Rainer M Krug @ 2012-01-25  9:14 UTC (permalink / raw)
  To: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

is there a way of skipping comments when exporting R code?

The reason is, that I have roxygen tags in my code, which I do not
want to bi included when I export the document to a pdf, as they are
only irritate readers not familiar with roxygen.
On the other hand, I would like to keep them in the code when
tangling, as basic documentation and a base for when / if I convert
the code to a package.

So my question: is there a way of suppressing comments in code on export?
I am aware that might be difficult, but possibly a parameter

#+PROPERTY: supressLines "##"

which supresses all code lines in code blocks starting with ## would
be great for this purpose.

Or is there another way of handling this issue?

Rainer


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8fx98ACgkQoYgNqgF2egrXSwCfTba9EsyAvNpkAWzrpFAsefXD
rnkAniVRBVJnF8HLUEFll2XexkzRREd2
=56mx
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [babel]Skip comments on code blocks on export?
  2012-01-25  9:14 [babel]Skip comments on code blocks on export? Rainer M Krug
@ 2012-01-27 22:46 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2012-01-27 22:46 UTC (permalink / raw)
  To: R.M.Krug; +Cc: emacs-orgmode

Hi Rainer,

You could add a function to the `org-babel-post-tangle-hook' to remove
comments from the resulting code file.  Functions on this hook are
called from within the tangled code file.

Best,

Rainer M Krug <r.m.krug@gmail.com> writes:

> Hi
>
> is there a way of skipping comments when exporting R code?
>
> The reason is, that I have roxygen tags in my code, which I do not
> want to bi included when I export the document to a pdf, as they are
> only irritate readers not familiar with roxygen.
> On the other hand, I would like to keep them in the code when
> tangling, as basic documentation and a base for when / if I convert
> the code to a package.
>
> So my question: is there a way of suppressing comments in code on export?
> I am aware that might be difficult, but possibly a parameter
>
> #+PROPERTY: supressLines "##"
>
> which supresses all code lines in code blocks starting with ## would
> be great for this purpose.
>
> Or is there another way of handling this issue?
>
> Rainer

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-27 23:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-25  9:14 [babel]Skip comments on code blocks on export? Rainer M Krug
2012-01-27 22:46 ` Eric Schulte

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).