summaryrefslogtreecommitdiffstats
path: root/contrib/libxo/doc
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2015-04-27 17:23:19 +0000
committermarcel <marcel@FreeBSD.org>2015-04-27 17:23:19 +0000
commitccd66731b4fbf326f52ead106e5c4b67656100f3 (patch)
tree2743e923a1c968c5a2a8292b75bf32c2e50bfbb3 /contrib/libxo/doc
parente0e7dcf8e606d1a79e3c5327f77915bc557841f3 (diff)
downloadFreeBSD-src-ccd66731b4fbf326f52ead106e5c4b67656100f3.zip
FreeBSD-src-ccd66731b4fbf326f52ead106e5c4b67656100f3.tar.gz
Upgrade libxo to 0.3.2.
Obtained from: https://github.com/Juniper/libxo/tree/0.3.2 Requested by: Phil Shafer <phil@juniper.net> This import incorporates local change 279966. Local change 276260 has been merged-in.
Diffstat (limited to 'contrib/libxo/doc')
-rw-r--r--contrib/libxo/doc/libxo.txt97
1 files changed, 93 insertions, 4 deletions
diff --git a/contrib/libxo/doc/libxo.txt b/contrib/libxo/doc/libxo.txt
index 31aec53..81a40b6 100644
--- a/contrib/libxo/doc/libxo.txt
+++ b/contrib/libxo/doc/libxo.txt
@@ -134,7 +134,7 @@ A single libxo function call in source code is all that's required:
<host>my-box</host>
<domain>example.com</domain>
JSON:
- "host": my-box",
+ "host": "my-box",
"domain": "example.com"
For brevity, the HTML output is emitted.
@@ -228,17 +228,17 @@ data, including data type, description, and an XPath location.
<div class="line">
<div class="data" data-tag="blocks">36</div>
<div class="padding"> </div>
- <div class="data data-tag="path">./src</div>
+ <div class="data" data-tag="path">./src</div>
</div>
<div class="line">
<div class="data" data-tag="blocks">40</div>
<div class="padding"> </div>
- <div class="data data-tag="path">./bin</div>
+ <div class="data" data-tag="path">./bin</div>
</div>
<div class="line">
<div class="data" data-tag="blocks">90</div>
<div class="padding"> </div>
- <div class="data data-tag="path">./</div>
+ <div class="data" data-tag="path">./</div>
</div>
** Format Strings @format-strings@
@@ -285,6 +285,7 @@ content. The roles are listed below; only one role is permitted:
|---+--------------+-------------------------------------------------|
| M | Name | Description |
|---+--------------+-------------------------------------------------|
+| C | color/effect | Field has color and effect controls |
| D | decoration | Field is non-text (e.g., colon, comma) |
| E | error | Field is an error message |
| L | label | Field is text that prefixes a value |
@@ -298,6 +299,56 @@ content. The roles are listed below; only one role is permitted:
| ] | stop anchor | End a section of anchored variable-width text |
|---+--------------+-------------------------------------------------|
+**** The Color Role ({C:})
+
+Colors and effects control how text values are displayed; they are
+used for display styles (TEXT and HTML). The color content can be
+either static, when placed directly within the field descriptor, or a
+printf-style format descriptor can be used, if preceded by a slash ("/"):
+
+ xo_emit("{C:bold}{Lwc:Cost}{:cost/%u}{C:reset}\n", cost);
+ xo_emit("{C:/fg-%s,bg-%s}{Lwc:Cost}{:cost/%u}{C:reset}\n",
+ fg_color, bg_color, cost);
+
+The content should be a comma-separated list of zero or more colors or
+display effects. Colors and effects remain in effect until
+modified by other "C" roles. If the content is empty, the "reset"
+action is performed.
+
+|---------------+-------------------------------------------------|
+| Name | Description |
+|---------------+-------------------------------------------------|
+| bg-XXXXX | Change background color |
+| bold | Start bold text effect |
+| fg-XXXXX | Change foreground color |
+| inverse | Start inverse (aka reverse) text effect |
+| no-bold | Stop bold text effect |
+| no-inverse | Stop inverse (aka reverse) text effect |
+| no-underline | Stop underline text effect |
+| normal | Reset effects (only) |
+| reset | Reset colors and effects (restore defaults) |
+| underline | Start underline text effect |
+|---------------+-------------------------------------------------|
+
+The following color names are supported:
+
+|---------------|
+| Name |
+|---------------|
+| black |
+| blue |
+| cyan |
+| default |
+| green |
+| magenta |
+| red |
+| white |
+| yellow |
+|---------------|
+
+Color names are prefixed with either "fg-" or "bg-" to change the
+foreground and background colors, respectively.
+
**** The Decoration Role ({D:})
Decorations are typically punctuation marks such as colons,
@@ -1404,9 +1455,21 @@ functions like xo_failure, xo_warn, xo_err, etc. The program name is
initialized by xo_parse_args, but subsequent calls to xo_set_program
can override this value.
+ xo_set_program(argv[0]);
+
Note that the value is not copied, so the memory passed to
xo_set_program (and xo_parse_args) must be maintained by the caller.
+*** xo_set_version
+
+The xo_set_version function records a version number to be emitted as
+part of the data for encoding styles (XML and JSON). This version
+number is suitable for tracking changes in the content, allowing a
+user of the data to discern which version of the data model is in use.
+
+ void xo_set_version (const char *version);
+ void xo_set_version_h (xo_handle_t *xop, const char *version);
+
*** Field Information (xo_info_t) @info@
HTML data can include additional information in attributes that
@@ -1705,6 +1768,32 @@ The "-V" option does not report errors, but prints a complete list of
all field names, sorted alphabetically. The output can help spot
inconsistencies and spelling errors.
+* xohtml
+
+xohtml is a tool for turning the output of libxo-enabled commands into
+html files suitable for display in modern HTML web browsers. It can
+be used to test and debug HTML output, as well as to make the user
+ache to escape the world of 70s terminal devices.
+
+xohtml is given a command, either on the command line or via the "-c"
+option. If not command is given, standard input is used. The
+command's output is wrapped in HTML tags, with references to
+supporting CSS and Javascript files, and written to standard output or
+the file given in the "-f" option. The "-b" option can be used to
+provide an alternative base path for the support files.
+
+|--------------+---------------------------------------------------|
+| Option | Meaning |
+|--------------+---------------------------------------------------|
+| -b <base> | Base path for finding css/javascript files |
+| -c <command> | Command to execute |
+| -f <file> | Output file name |
+|--------------+---------------------------------------------------|
+
+The "-c" option takes a full command with arguments, including
+any libxo options needed to generate html ("--libxo=html"). This
+value must be quoted if it consists of multiple tokens.
+
* FAQs
This section contains the set of questions that users typically ask,
OpenPOWER on IntegriCloud