freebsd-dev/contrib/libxo/xohtml/xohtml.sh.in
Phil Shafer fd5e3f3ec6 Update from libxo-0.8.1 to 0.8.4:
0.8.4:
    - void anchor width optimization when we have a custom formatter (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221130)
    - make "{[:/18}" do the right thing (also allows "{[:/%s}", wide ? 40 : 10)
    - Can't skip anchor formatting in non-display styles
    - add test case for {[:/18}
    - add upload-xohtml-files to 'make upload'
  0.8.3:
    - xohtml: Add "-w" option to pull support files from gh_pages
    - Add "upload-xohtml-files" target to publish support files in gh_pages/
    - add HISTORY/AUTHORS section to man pages
  0.8.2:
    - xohtml: Add div.units as standard CSS text
    - Don't treat values as format strings; they are not
    - add "-p" to "mkdir -p build" in setup.sh
    - add test case for {U:%%} (from df.c)
    - detect end-of-string in '%' and '' escaping
    - make xo_simple_field, for common simple cases
    - xohtml: nuke "n" in "echo" commands
    - rename "format" to "fmt" for consistency; same for "str" to "value"

Submitted by:	phil
2017-08-03 15:47:42 +00:00

86 lines
1.9 KiB
Bash

#!/bin/sh
#
# Copyright (c) 2014, 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.
# Phil Shafer, July 2014
#
BASE=@XO_SHAREDIR@
VERSION=@LIBXO_VERSION@
CMD=cat
DONE=
WEB=http://juniper.github.io/libxo/${VERSION}/xohtml
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)
shift;
BASE="$1";
shift;
;;
-c|--command)
shift;
CMD="$1";
shift;
;;
-f|--file)
shift;
FILE="$1";
shift;
exec > "$FILE";
;;
-w|--web)
shift;
BASE="${WEB}";
;;
-*)
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>'
echo '<head>'
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>'
echo '<link rel="stylesheet" href="'$BASE'/xohtml.css">'
echo '<link rel="stylesheet" href="'$BASE'/external/jquery.qtip.css"/>'
echo '<script type="text/javascript" src="'$BASE'/external/jquery.js"></script>'
echo '<script type="text/javascript" src="'$BASE'/external/jquery.qtip.js"></script>'
echo '<script type="text/javascript" src="'$BASE'/xohtml.js"></script>'
echo '<script>'
echo '</script>'
echo '</head>'
echo '<body>'
$CMD
echo '</body>'
echo '</html>'
exit 0