|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| bin/ | H | 10-Jan-2016 | - | 94 | 56 |
| build/ | H | 10-Jan-2016 | - | | |
| doc/ | H | 10-Jan-2016 | - | 3,829 | 3,070 |
| encoder/ | H | 10-Jan-2016 | - | 511 | 347 |
| libxo/ | H | 10-Jan-2016 | - | 13,642 | 10,233 |
| m4/ | H | 10-Jan-2016 | - | 9,055 | 8,184 |
| packaging/ | H | 10-Jan-2016 | - | 78 | 58 |
| tests/ | H | 10-Jan-2016 | - | 9,937 | 8,950 |
| xo/ | H | 10-Jan-2016 | - | 659 | 550 |
| xohtml/ | H | 10-Jan-2016 | - | 13,872 | 9,780 |
| xolint/ | H | 10-Jan-2016 | - | 802 | 506 |
| xopo/ | H | 10-Jan-2016 | - | 415 | 327 |
| .gitignore | HD | 10-Jan-2016 | 381 | 47 | 38 |
| .travis.yml | HD | 10-Jan-2016 | 281 | 13 | 9 |
| Copyright | HD | 10-Jan-2016 | 1.3 KiB | 24 | 21 |
| INSTALL.md | HD | 10-Jan-2016 | 459 | 16 | 3 |
| LICENSE | HD | 10-Jan-2016 | 1.3 KiB | 24 | 19 |
| Makefile.am | HD | 10-Jan-2016 | 3 KiB | 103 | 74 |
| README.md | HD | 10-Jan-2016 | 1.8 KiB | 65 | 56 |
| configure.ac | HD | 10-Jan-2016 | 12.8 KiB | 453 | 382 |
| install-sh | HD | 10-Jan-2016 | 13.7 KiB | 528 | 351 |
| libxo-config.in | HD | 10-Jan-2016 | 2 KiB | 120 | 86 |
| warnings.mk | HD | 10-Jan-2016 | 1.2 KiB | 58 | 38 |
README.md
1libxo
2=====
3
4libxo - A Library for Generating Text, XML, JSON, and HTML Output
5
6The libxo library allows an application to generate text, XML, JSON,
7and HTML output using a common set of function calls. The application
8decides at run time which output style should be produced. The
9application calls a function "xo_emit" to product output that is
10described in a format string. A "field descriptor" tells libxo what
11the field is and what it means.
12
13```
14 xo_emit(" {:lines/%7ju/%ju} {:words/%7ju/%ju} "
15 "{:characters/%7ju/%ju}{d:filename/%s}\n",
16 linect, wordct, charct, file);
17```
18
19Output can then be generated in various style, using the "--libxo"
20option:
21
22```
23 % wc /etc/motd
24 25 165 1140 /etc/motd
25 % wc --libxo xml,pretty,warn /etc/motd
26 <wc>
27 <file>
28 <filename>/etc/motd</filename>
29 <lines>25</lines>
30 <words>165</words>
31 <characters>1140</characters>
32 </file>
33 </wc>
34 % wc --libxo json,pretty,warn /etc/motd
35 {
36 "wc": {
37 "file": [
38 {
39 "filename": "/etc/motd",
40 "lines": 25,
41 "words": 165,
42 "characters": 1140
43 }
44 ]
45 }
46 }
47 % wc --libxo html,pretty,warn /etc/motd
48 <div class="line">
49 <div class="text"> </div>
50 <div class="data" data-tag="lines"> 25</div>
51 <div class="text"> </div>
52 <div class="data" data-tag="words"> 165</div>
53 <div class="text"> </div>
54 <div class="data" data-tag="characters"> 1140</div>
55 <div class="text"> </div>
56 <div class="data" data-tag="filename">/etc/motd</div>
57 </div>
58```
59
60View the beautiful documentation at:
61
62http://juniper.github.io/libxo/libxo-manual.html
63
64[](https://github.com/Juniper/libxo)
65