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