emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Seeking advice for conditional code
@ 2013-01-31 17:09 François Pinard
  2013-01-31 18:55 ` John Kitchin
  2013-01-31 21:03 ` Sebastien Vauban
  0 siblings, 2 replies; 8+ messages in thread
From: François Pinard @ 2013-01-31 17:09 UTC (permalink / raw)
  To: emacs-orgmode

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

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

end of thread, other threads:[~2013-02-02  0:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-31 17:09 Seeking advice for conditional code François Pinard
2013-01-31 18:55 ` John Kitchin
2013-01-31 21:03 ` Sebastien Vauban
2013-01-31 22:09   ` François Pinard
2013-01-31 22:56     ` Sebastien Vauban
2013-02-01  2:25       ` François Pinard
2013-02-01  8:24         ` Sebastien Vauban
2013-02-02  0:46           ` Eric S Fraga

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).