Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
doc/ | H | - | - | 6,753 | 5,090 | |
encoder/ | H | - | - | 1,402 | 887 | |
libxo/ | H | - | - | 15,521 | 11,772 | |
packaging/ | H | - | - | 78 | 58 | |
tests/ | H | - | - | 13,417 | 12,279 | |
xo/ | H | - | - | 812 | 672 | |
xohtml/ | H | - | - | 13,886 | 9,793 | |
xolint/ | H | - | - | 814 | 516 | |
xopo/ | H | - | - | 422 | 334 | |
.gitignore | H A D | 30-Jan-2023 | 438 | 33 | 32 | |
.travis.yml | H A D | 28-Oct-2015 | 281 | 13 | 9 | |
Copyright | H A D | 13-Jan-2015 | 1.3 KiB | 24 | 21 | |
INSTALL.md | H A D | 28-Oct-2015 | 459 | 16 | 3 | |
LICENSE | H A D | 13-Jan-2015 | 1.3 KiB | 24 | 19 | |
Makefile.am | H A D | 30-Jan-2023 | 4.2 KiB | 145 | 110 | |
README.md | H A D | 07-Nov-2019 | 1.9 KiB | 68 | 58 | |
configure.ac | H A D | 30-Jan-2023 | 14.6 KiB | 501 | 425 | |
libxo-config.in | H A D | 16-Apr-2016 | 1.9 KiB | 120 | 86 | |
warnings.mk | H A D | 13-Jan-2015 | 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 13Imagine a simplified ``wc`` that emits its output fields in a single 14xo_emit call: 15 16``` 17 xo_emit(" {:lines/%7ju/%ju} {:words/%7ju/%ju} " 18 "{:characters/%7ju/%ju}{d:filename/%s}\n", 19 linect, wordct, charct, file); 20``` 21 22Output can then be generated in various style, using the "--libxo" 23option: 24 25``` 26 % wc /etc/motd 27 25 165 1140 /etc/motd 28 % wc --libxo xml,pretty,warn /etc/motd 29 <wc> 30 <file> 31 <filename>/etc/motd</filename> 32 <lines>25</lines> 33 <words>165</words> 34 <characters>1140</characters> 35 </file> 36 </wc> 37 % wc --libxo json,pretty,warn /etc/motd 38 { 39 "wc": { 40 "file": [ 41 { 42 "filename": "/etc/motd", 43 "lines": 25, 44 "words": 165, 45 "characters": 1140 46 } 47 ] 48 } 49 } 50 % wc --libxo html,pretty,warn /etc/motd 51 <div class="line"> 52 <div class="text"> </div> 53 <div class="data" data-tag="lines"> 25</div> 54 <div class="text"> </div> 55 <div class="data" data-tag="words"> 165</div> 56 <div class="text"> </div> 57 <div class="data" data-tag="characters"> 1140</div> 58 <div class="text"> </div> 59 <div class="data" data-tag="filename">/etc/motd</div> 60 </div> 61``` 62 63View the beautiful documentation at: 64 65http://juniper.github.io/libxo/libxo-manual.html 66 67[](https://github.com/Juniper/libxo) 68