emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Seeking advice for conditional code


From: François Pinard
Subject: [O] Seeking advice for conditional code
Date: Thu, 31 Jan 2013 12:09:34 -0500
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/23.4 (gnu/linux)

Hi, Org friends.

Would someone be kind enough to point me in the right direction, if
there is one already?  My need is to have conditional code at
publication time, and being able to include or exclude regions of code
according to some symbol being "active" or "defined", or not.

The use case is a piece of Python code implementing an API interface,
for which items are implemented through functions (methods).  These
functions each have a doc-string, using Org, documenting that item.
Now, there are API items which we publish for our users, and other API
items which are rather internal and which we would not document
externally.  I would much prefer keeping a single source, and generate
different documentation for the external site and the internal site.

Currently, I use poporg (https://github.com/pinard/poporg) to edit these
doc-strings, and a small program which reads and concatenate them all.
This program already recognizes #+FILE: (not Org standard) to drive the
splitting of the resulting Org document into many files, each of which
will end up being an HTML page.  The first idea which comes to my mind
is adding #+IF: #+ELIF: #+ELSE #+ENDIF directives for that program to
recognize as well.

But if possible, I would much prefer to stick to known and standard Org
paradigms than inventing my own, and this is why I'm asking here...

Keep happy, all!

François



reply via email to

[Prev in Thread] Current Thread [Next in Thread]