1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
.de d \" begin display
.sp
.in +4
.nf
..
.de e \" end display
.in -4
.fi
.sp
..
.TH "HXINCL" "1" "10 Jul 2011" "6.x" "HTML-XML-utils"
.SH NAME
hxincl \- expand included HTML or XML files
.SH SYNOPSIS
.B hxincl
.RB "[\| " \-x " \|]"
.RB "[\| " \-f " \|]"
.RB "[\| " \-s
.IR name=subst " \|]"
.RB "[\| " \-s
.IR name=subst " \|]..."
.RB "[\| " \-b
.IR base " \|]"
.RI "[\| " file\-or\-URL " \|]"
.SH DESCRIPTION
.LP
The
.B hxincl
command copies an HTML or XML file to standard output, looking for
comments with a certain structure. Such a comment is replaced by
the file whose name is given as the attribute of the directive. For
example:
.d
\&...<!-- include "foo.html" -->...
.e
will be replaced by the content of the file \fIfoo.html\fP. It is
important to note that you must quote filenames if they contain
white space.
.LP
The comment is replaced by
.d
<!-- begin-include "foo.html" -->
.e
before the included text and
.d
<!-- end-include "foo.html" -->
.e
after it. These comments make it possible to run
.B hxincl
on the resulting file again to update the inclusions.
.PP
Single quotes are allowed instead of double quotes. And if the file
name contains no spaces, the quotes may also be omitted.
.SH OPTIONS
The following options are supported:
.TP 10
.B \-x
Use XML conventions: empty elements are written with a slash at the
end: <IMG\ />.
.TP
.BI \-b " base"
Sets the base URL for resolving relative URLs. By default the file
given as argument is the base URL.
.TP
.B \-f
Removes the comments after including the files. This means
.B hxincl
connot be run on the resulting file later to update the inclusions.
(Mnemonic:
.BR f inal
or
.BR f rozen.)
.TP
.BI \-s " name=substitution"
Include a different file than the one mentioned in the directive. If
the comment is
.d
<!-- include "name" -->
.e
the file
.I substitution
is included instead. The option
.B \-s
may occur multiple times.
.SH OPERANDS
The following operand is supported:
.TP 10
.I file\-or\-URL
The name of an HTML or XML file or the URL of one. If absent, standard
input is read instead.
.SH "EXIT STATUS"
The following exit values are returned:
.TP 10
.B 0
Successful completion.
.TP
.B > 0
An error occurred in the parsing of one of the HTML or XML files.
.SH ENVIRONMENT
To use a proxy to retrieve remote files, set the environment variables
.B http_proxy
or
.BR ftp_proxy "."
E.g.,
.B http_proxy="http://localhost:8080/"
.SH BUGS
.LP
Assumes UTF-8 as input. Doesn't expand character entities. Instead
pipe the input through
.BR hxunent (1)
and
.BR asc2xml (1)
to convert it to UTF-8.
.LP
Remote files (specified with a URL) are currently only supported for
HTTP. Password-protected files or files that depend on HTTP "cookies"
are not handled. (You can use tools such as
.BR curl (1)
or
.BR wget (1)
to retrieve such files.)
.SH "SEE ALSO"
.BR asc2xml (1),
.BR hxnormalize (1),
.BR hxnum (1),
.BR hxprune (1),
.BR hxtoc (1),
.BR hxunent (1),
.BR xml2asc (1),
.BR UTF-8 " (RFC 2279)"
|