File: hxref.1

package info (click to toggle)
html-xml-utils 6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,620 kB
  • sloc: ansic: 10,027; sh: 2,135; lex: 189; yacc: 125; perl: 123; makefile: 122
file content (122 lines) | stat: -rw-r--r-- 3,297 bytes parent folder | download
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
.de d \" begin display
.sp
.in +4
.nf
..
.de e \" end display
.in -4
.fi
.sp
..
.TH "HXREF" "1" "10 Jul 2011" "6.x" "HTML-XML-utils"
.SH NAME
hxref \- generate cross-references inside and between HTML files
.SH SYNOPSIS
.B hxref
.RB "[\| " \-x " \|]"
.RB "[\| " \-l " \|]"
.RB "[\| " \-b
.IR base " \|]"
.RB "[\| " \-i
.IR index " \|]"
.RI "[\| -- \|] [\| " input " [\| " output " \|] \|]"
.SH DESCRIPTION
.LP
The
.B hxref
command links inline elements to DFN elements with the same content.
It adds ID attributes where necessary. If the content of a DFN or
other element isn't suitable, the TITLE attribute may be used to
provide the term to use for comparisons.
.LP
Here is an example:
.d
<p>A <dfn>b-box</dfn> is defined to be...
<p>For every b there is a <em>b-box</em>...
.e
The output of
.B hxref
will be similar to this:
.d
<p>A <dfn id="b-box">b-box</dfn> is defined to be...
<p>For every b there is a <a href="#b-box"><em>b-box</em></a>...
.e
.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 prefix for the generated URLs. By default
.I base
is empty, which generates URLs like "#b-box" above. If
.I base
is set to, e.g., "http://xyz/", the URLs will look like
"http://xyz/#b-box".
.TP
.BI \-i " index"
Directs
.B hxref
to read terms from a database file before looking for them in the
document and afterwards store the terms that were found in the same
file. DFN element in the document override terms found in
.IR index "."
This allows
.B hxref
to be run multiple times on different files, to make the files refer
to each other. It may be necessary to run the commands twice, to
resolve all cross-references.
.TP
.B \-l
Try to use language-specific information to match instances to their
definitions. Currently, only English is supported and the only rules
applied are to search without a final "s" ("trees" matches "tree"),
without a final "es" ("bosses" matches "boss") and with a "y"
replacing a final "ies" ("bounties" matches "bounty").
.B hxref
determines the language from "lang" and "xml:lang" attributes in the
document.
.SH OPERANDS
The following operands are supported:
.TP 10
.I input
The name of an HTML file. If absent, standard input is read instead.
The special name "-" also indicates standard input. The
.I input
may be an URL.
.TP
.I output
The file to write to. If absent, standard output is used. This may
.I not
be a URL.
.SH "DIAGNOSTICS"
The following exit values are returned:
.TP 10
.B 0
Successful completion.
.TP
.B > 0
An error occurred in the parsing of the HTML file.
.B hxref
will try to correct the error and produce output anyway.
.SH "SEE ALSO"
.BR asc2xml (1),
.BR hxindex (1),
.BR hxnormalize (1),
.BR hxnum (1),
.BR hxtoc (1),
.BR xml2asc (1)
.SH BUGS
.LP
The error recovery for incorrect HTML is primitive.
.LP
The program generates ID attributes, but doesn't generate <a name=...>
tags, so the links only work in browsers that recognize ID attributes.
.LP
The rules for matching English plurals are primitif. No dictionary is
used. E.g., "bees" will be considered a plural of "be".
.LP
There is currently no way to set the default language for a document
for when the root element has no "lang" or "xml:lang" attribute.