Lines Matching +full:product +full:- +full:name
1 .. index:: --libxo, xo
11 The style of output can be selected using a specific option: "-X" for
12 XML, "-J" for JSON, "-H" for HTML, or "-T" for TEXT, which is the
13 default. The "--style <style>" option can also be used. The standard
14 set of "--libxo" options are available (see :ref:`options`), as well
15 as the :ref:`LIBXO_OPTIONS <libxo-options>` environment variable.
20 xo "The {k:name} weighs {:weight/%d} pounds.\n" fish 6
26 <name>fish</name>
30 "name": "fish",
36 <div class="data" data-tag="name">fish</div>
38 <div class="data" data-tag="weight">6</div>
42 The `--wrap $path` option can be used to wrap emitted content in a
46 xo --wrap top/a/b/c '{:tag}' value
70 The `--open $path` and `--close $path` can be used to emit
73 then close tags. The `--depth` option may be used to set the
74 depth for indentation. The `--leading-xpath` may be used to
79 xo --open top/data
80 xo --depth 2 '{:tag}' value
81 xo --close top/data
98 include a newline), use the `--continuation` option to let secondary
101 When emitting a series of objects, use the `--not-first` option to
105 Use the `--top-wrap` option to ensure any top-level object details are
106 handled correctly, e.g. wrap the entire output in a top-level set of
113 xo --top-wrap --open top/data
114 xo --depth 2 'First {:tag} ' value1
115 xo --depth 2 --continuation 'and then {:tag}\n' value2
116 xo --top-wrap --close top/data
124 <div class="data" data-tag="tag">value1</div>
127 <div class="data" data-tag="tag">value2</div>
149 -------------------
157 Use the `--open-list` and `--open-instances` to open lists and
158 instances. Use the `--close-list` and `--close-instances` to close
159 them. Each of these options take a `name` parameter, providing the
160 name of the list and instance.
165 opts="--json"
166 xo $opts --open-list machine
168 for name in red green blue; do
169 xo $opts --depth 1 $NF --open-instance machine
170 xo $opts --depth 2 "Machine {k:name} has {:memory}\n" $name 55
171 xo $opts --depth 1 --close-instance machine
172 NF=--not-first
174 xo $opts $NF --close-list machine
181 The `--instance` option can be used to treat a single `xo` invocation
184 % xo --libxo:XP --instance foo 'The {:product} is {:status}\n' stereo "in route"
186 <product>stereo</product>
191 --------------------
196 --close <path> Close tags for the given path
197 --close-instance <name> Close an open instance name
198 --close-list <name> Close an open list name
199 --continuation OR -C Output belongs on same line as previous output
200 --depth <num> Set the depth for pretty printing
201 --help Display this help text
202 --html OR -H Generate HTML output
203 --instance OR -I <name> Wrap in an instance of the given name
204 --json OR -J Generate JSON output
205 --leading-xpath <path> Add a prefix to generated XPaths (HTML)
206 --not-first Indicate this object is not the first (JSON)
207 --open <path> Open tags for the given path
208 --open-instance <name> Open an instance given by name
209 --open-list <name> Open a list given by name
210 --option <opts> -or -O <opts> Give formatting options
211 --pretty OR -p Make 'pretty' output (add indent, newlines)
212 --style <style> Generate given style (xml, json, text, html)
213 --text OR -T Generate text output (the default style)
214 --top-wrap Generate a top-level object wrapper (JSON)
215 --version Display version information
216 --warn OR -W Display warnings in text on stderr
217 --warn-xml Display warnings in xml on stdout
218 --wrap <path> Wrap output in a set of containers
219 --xml OR -X Generate XML output
220 --xpath Add XPath data to HTML output)
223 -------
227 % xo 'The {:product} is {:status}\n' stereo "in route"
229 % xo -p -X 'The {:product} is {:status}\n' stereo "in route"
230 <product>stereo</product>
232 % xo --libxo xml,pretty 'The {:product} is {:status}\n' stereo "in route"
233 <product>stereo</product>