summaryrefslogtreecommitdiffstats
path: root/contrib/libxo/xohtml
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/xohtml
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/xohtml')
-rw-r--r--contrib/libxo/xohtml/Makefile.am38
-rw-r--r--contrib/libxo/xohtml/xohtml.1125
-rw-r--r--contrib/libxo/xohtml/xohtml.css24
-rw-r--r--contrib/libxo/xohtml/xohtml.sh.in20
4 files changed, 207 insertions, 0 deletions
diff --git a/contrib/libxo/xohtml/Makefile.am b/contrib/libxo/xohtml/Makefile.am
new file mode 100644
index 0000000..49dffed
--- /dev/null
+++ b/contrib/libxo/xohtml/Makefile.am
@@ -0,0 +1,38 @@
+#
+# Copyright 2015, Juniper Networks, Inc.
+# All rights reserved.
+# This SOFTWARE is licensed under the LICENSE provided in the
+# ../Copyright file. By downloading, installing, copying, or otherwise
+# using the SOFTWARE, you agree to be bound by the terms of that
+# LICENSE.
+
+man_MANS = xohtml.1
+
+EXTERNAL_FILES = \
+ external/jquery.js \
+ external/jquery.qtip.css \
+ external/jquery.qtip.js
+
+INTERNAL_FILES = \
+ xohtml.js \
+ xohtml.css
+
+EXTRA_DIST = \
+ xohtml.1 \
+ xohtml.sh.in \
+ ${INTERNAL_FILES} \
+ ${EXTERNAL_FILES}
+
+install-exec-hook:
+ install xohtml.sh ${DESTDIR}${bindir}/xohtml
+ mkdir -p ${DESTDIR}${XO_SHAREDIR}/external
+ for file in ${INTERNAL_FILES}; do \
+ install ${srcdir}/$$file ${DESTDIR}${XO_SHAREDIR} ; done
+ for file in ${EXTERNAL_FILES}; do \
+ install ${srcdir}/$$file ${DESTDIR}${XO_SHAREDIR}/external ; done
+
+uninstall-hook:
+ for file in ${INTERNAL_FILES} ${EXTERNAL_FILES}; do \
+ rm ${DESTDIR}${XO_SHAREDIR}/$$file ; done
+ rmdir ${DESTDIR}${XO_SHAREDIR}/external
+ rm -f ${DESTDIR}${bindir}/xohtml
diff --git a/contrib/libxo/xohtml/xohtml.1 b/contrib/libxo/xohtml/xohtml.1
new file mode 100644
index 0000000..d520cb3
--- /dev/null
+++ b/contrib/libxo/xohtml/xohtml.1
@@ -0,0 +1,125 @@
+.\" #
+.\" # Copyright (c) 2015, Juniper Networks, Inc.
+.\" # All rights reserved.
+.\" # This SOFTWARE is licensed under the LICENSE provided in the
+.\" # ../Copyright file. By downloading, installing, copying, or
+.\" # using the SOFTWARE, you agree to be bound by the terms of that
+.\" # LICENSE.
+.\" # Phil Shafer, July 2014
+.\"
+.Dd December 4, 2014
+.Dt XOHTML 1
+.Os
+.Sh NAME
+.Nm xohtml
+.Nd display libxo html output
+.Xr xo_emit 3
+.Sh SYNOPSIS
+.Nm xohtml
+.Op Fl c
+.Op Fl "b <base>"
+.Op Fl "c" <command>"
+.Op Fl "f" <output>
+.Op Ar command argument...
+.Sh DESCRIPTION
+.Nm
+is a tool for preparing
+.Xr libxo 3
+HTML output for display in modern HTML web browsers.
+.Nm
+can operate in two modes.
+If command is provided
+either with the
+.Fl c
+option or as argument(s) to the
+.Nm
+command, that command is executed and the resulting output is processed.
+If no command is given, the
+standard input is used.
+.Pp
+.Nm
+is typically used to wrap
+.Nm libxo
+output with sufficient HTML content to allow display in a web browser.
+This includes parent HTML tags as well as
+.Nm CSS
+stylesheets and
+.Nm Javascript
+files.
+.Pp
+If the command is given directly on the command line,
+.Nm
+will add the "--libxo=html" option needed to generate HTML output
+from
+.Nm libxo "-enabled"
+applications. See
+.Xr libxo 3
+for details.
+.Pp
+The following options are available:
+.Bl -tag -width indent
+.It Fl "b <base>"
+.It Fl "-base <base>"
+Supplies a source path for the CSS and Javascript files referenced in
+the output of
+.Nm xohtml .
+.It Fl "c <command>"
+.It Fl "-command <command>"
+Use the given command instead of one on the command line.
+This command should be quoted if it consists of multiple tokens, and
+should contain the "--libxo=html" option or equivalent, since the
+command is used directly.
+.It Fl "f <file>"
+.It Fl "-file <file>"
+Output is saved to the given file, rather than to the standard output
+descriptor.
+.El
+.Pp
+.Sh EXAMPLES
+The following command line will run "du --libxo=html ~/src" and save
+the output to /tmp/src.html:
+.Bd -literal -offset indent
+ xohtml du ~/src > /tmp/src.html
+.Ed
+.Pp
+The following command line will run "du --libxo=html,warn ~/src" and save
+the output to /tmp/src.html:
+.Bd -literal -offset indent
+ du --libxo=html,warn ~/src | xohtml -f /tmp/src.html
+.Ed
+.Pp
+The following command line will run "du --libxo=html,warn ~/src" and save
+the output to /tmp/src.html:
+.Bd -literal -offset indent
+ xohtml -c "du --libxo=html,warn ~/src" -f /tmp/src.html
+.Ed
+.Pp
+.Sh ADDITIONAL DOCUMENTATION
+Complete documentation can be found on github:
+.Bd -literal -offset indent
+http://juniper.github.io/libxo/libxo-manual.html
+.Ed
+.Pp
+.Nm libxo
+lives on github as:
+.Bd -literal -offset indent
+https://github.com/Juniper/libxo
+.Ed
+.Pp
+The latest release of
+.Nm libxo
+is available at:
+.Bd -literal -offset indent
+https://github.com/Juniper/libxo/releases
+.Ed
+.Sh SEE ALSO
+.Xr libxo 3 ,
+.Xr xo_emit 3
+.Sh HISTORY
+The
+.Nm libxo
+library was added in
+.Fx 11.0 .
+.Sh AUTHOR
+Phil Shafer
+
diff --git a/contrib/libxo/xohtml/xohtml.css b/contrib/libxo/xohtml/xohtml.css
index 655bf12..fc9ea06 100644
--- a/contrib/libxo/xohtml/xohtml.css
+++ b/contrib/libxo/xohtml/xohtml.css
@@ -1014,3 +1014,27 @@ div.xpath {
position: relative;
top: 1px;
}
+
+div.color-fg-black { color: black; }
+div.color-fg-red { color: red; }
+div.color-fg-green { color: green; }
+div.color-fg-yellow { color: yellow; }
+div.color-fg-blue { color: blue; }
+div.color-fg-magenta { color: magenta; }
+div.color-fg-cyan { color: cyan; }
+div.color-fg-white { color: white; }
+
+div.color-bg-black { background-color: black; }
+div.color-bg-red { background-color: red; }
+div.color-bg-green { background-color: green; }
+div.color-bg-yellow { background-color: yellow; }
+div.color-bg-blue { background-color: blue; }
+div.color-bg-magenta { background-color: magenta; }
+div.color-bg-cyan { background-color: cyan; }
+div.color-bg-white { background-color: white; }
+
+div.color-fg-inverse { color: white; }
+div.color-bg-inverse { background-color: black; }
+
+div.effect-bold { font-weight:bold; }
+div.effect-underline { text-decoration: underline; }
diff --git a/contrib/libxo/xohtml/xohtml.sh.in b/contrib/libxo/xohtml/xohtml.sh.in
index cbd3066..a15d82e 100644
--- a/contrib/libxo/xohtml/xohtml.sh.in
+++ b/contrib/libxo/xohtml/xohtml.sh.in
@@ -13,6 +13,16 @@ BASE=@XO_SHAREDIR@
CMD=cat
DONE=
+do_help () {
+ echo "xohtml: wrap libxo-enabled output in HTML"
+ echo "Usage: xohtml [options] [command [arguments]]"
+ echo "Valid options are:"
+ echo " -b <basepath> | --base <basepath>"
+ echo " -c <command> | --command <command>"
+ echo " -f <output-file> | --file <output-file>"
+ exit 1
+}
+
while [ -z "$DONE" -a ! -z "$1" ]; do
case "$1" in
-b|--base)
@@ -31,12 +41,22 @@ while [ -z "$DONE" -a ! -z "$1" ]; do
shift;
exec > "$FILE";
;;
+ -*)
+ do_help
+ ;;
*)
DONE=1;
+ XX=$1;
+ shift;
+ CMD="$XX --libxo=html $@"
;;
esac
done
+if [ "$CMD" = "cat" -a -t 0 ]; then
+ do_help
+fi
+
echo "<html>\n<head>\n"
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>'
echo '<link rel="stylesheet" href="'$BASE'/xohtml.css">'
OpenPOWER on IntegriCloud