Codex

Code Extractor for OpenOffice.org

The codex tool is a simple program that examines an OpenOffice.org document, looking for code listings and snippets. It extracts the body of each listing and snippet to separate text files.

A snippet is one or more adjacent paragraphs that have a code style applied, such as Preformatted Text. A listing is like a snippet, but it starts with a caption style, followed immediately by code style paragraphs.

You can control which style names codex considers to be caption styles and which are code styles by means of a configuration file. The default configuration file uses Caption as the name of the sole caption style and Code and Preformatted Text as the names of the two code styles.

The codex utility is released under the GNU General Public License. The code and this document are copyright © 2006 by Ray Lischner.

Download

Download sources and binary RPMS.

Documentation

Read the man pages online:

codex.1 (man page for the program)

codex.5 (man page for the configuration file format)

Build Notes

The source code includes a standard configure script. It checks for a few dependencies, in particular two libraries:

It also checks for the strcasecmp function, which is part of the GNU C library, but might not be available on other platforms.