libxo - A Library for Generating Text, XML, JSON, and HTML Output¶
The libxo library allows an application to generate text, XML, JSON, and HTML output, suitable for both command line use and for web applications. The application decides at run time which output style should be produced. By using libxo, a single source code path can emit multiple styles of output using command line options to select the style, along with optional behaviors. libxo includes support for multiple output streams, pluralization, color, syslog, humanized(3) output, internationalization, and UTF-8. The library aims to minimize the cost of migrating code to libxo.
libxo ships as part of FreeBSD.
- Introducing libxo
- Getting libxo
- Formatting with libxo
- Command-line Arguments
- Format Strings
- Field Roles
- Field Modifiers
- The Argument Modifier ({a:})
- The Colon Modifier ({c:})
- The Display Modifier ({d:})
- The Encoding Modifier ({e:})
- The Gettext Modifier ({g:})
- The Humanize Modifier ({h:})
- The Key Modifier ({k:})
- The Leaf-List Modifier ({l:})
- The No-Quotes Modifier ({n:})
- The Plural Modifier ({p:})
- The Quotes Modifier ({q:})
- The Trim Modifier ({t:})
- The White Space Modifier ({w:})
- Field Formatting
- The libxo API
- Encoders
- The “xo” Utility
- xolint
- xohtml
- xopo
- FAQs
- Howtos: Focused Directions
- Examples