4
4
< body >
5
5
< h1 > Web-based checking with vnu.war or vnu.jar</ h1 >
6
6
7
- < p > Along with < a href ="./ "> command-line use</ a > ,
8
- the < code > vnu.jar</ code > package is suited to use
9
- as a simple < a href ="#web-based-usage "> standalone HTTP server.</ a >
10
- If you want to deploy the application to a servlet container
11
- such as Apache Tomcat you will probably want to use the
12
- < code > vnu.war</ code > package instead.
7
+ < p > The Nu Markup Checker— along with being usable as
8
+ < a href ="http://validator.github.io/#usage "> a standalone command-line client</ a > —
9
+ can be run as an HTTP service, similar to
10
+ < a href ="http://html5.validator.nu/ "> http://html5.validator.nu/</ a >
11
+ and
12
+ < a href ="http://validator.w3.org/nu/ "> http://validator.w3.org/nu/</ a > ,
13
+ for browser-based checking of HTML documents over
14
+ the Web.
15
+ To that end, the checker is released as two separate packages:
16
+ < ul >
17
+ < li > < code > vnu.jar</ code > for
18
+ < a href ="#standalone "> deploying the checker as a simple standalone service</ a >
19
+ < li > < code > vnu.war</ code > for
20
+ < a href ="#servlet "> deploying the checker to a servlet container such as Tomcat</ a >
21
+ </ ul >
22
+ < p >
23
+ Both deployments expose a REST API that enables checking of HTML
24
+ documents from other clients, not just web browsers. And the
25
+ < code > vnu.jar</ code > package also includes
26
+ < a href ="#http-client "> a simple HTTP client</ a > that enables you to
27
+ either send documents to a locally-running instance of the checker HTTP
28
+ service— for fast command-line checking— or to any remote instance of the
29
+ checker HTTP service running anywhere on the Web.
30
+ < p >
13
31
The
14
- < a href ="https://github.com/validator/validator.github.io/releases/latest " > latest releases of these files </ a >
32
+ < a href ="https://github.com/validator/validator.github.io/releases/latest " > latest releases of the vnu.jar and vnu.war packages </ a >
15
33
are available from the < code > validator</ code > project at github.
16
- The following are instructions demonstrating how to use these two
17
- packages to provide a service for browser-based checking of
18
- HTML documents over the web.
34
+ The following are detailed instructions on using them.
19
35
20
36
< p class =note > < b > Note:</ b > Replace
21
37
< var > "~/vnu.jar"</ var > or < var > "~/vnu.war"</ var > below
@@ -28,24 +44,11 @@ <h1>Web-based checking with vnu.war or vnu.jar</h1>
28
44
< a href ="#http-client-options "> Options</ a >
29
45
30
46
< div class =set >
31
- < section id =web-based-usage >
32
- < h2 > Web-based usage</ h2 >
33
-
34
- < p > You can use < code > vnu.jar</ code > or < code > vnu.war</ code > to provide a service for
35
- browser-based checking of HTML documents over the web, similar to
36
- < a href ="http://html5.validator.nu/ "> http://html5.validator.nu/</ a >
37
- and
38
- < a href ="http://validator.w3.org/nu/ "> http://validator.w3.org/nu/</ a > .
39
- The service also includes a REST API for providing checking of HTML
40
- documents for other clients, not just web browsers.
41
-
42
- </ section >
43
47
< section id =standalone >
44
48
< h2 > Standalone web server</ h2 >
45
- < p > To run the markup checker as a standalone service
46
- (using a built-in Jetty server),
47
- open a new terminal window
48
- and invoke < code > vnu.jar</ code > like this:
49
+ < p > To run the markup checker as a standalone service (using a built-in
50
+ Jetty server), open a new terminal window and invoke < code > vnu.jar</ code >
51
+ like this:
49
52
50
53
< pre >
51
54
java -cp ~/vnu.jar < span class =java-class > nu.validator.servlet.Main</ span > < span class =arg > 8888</ span >
@@ -121,39 +124,50 @@ <h2>Deployment to servlet container</h2>
121
124
< section id =http-client >
122
125
< h2 > HTTP client (for fast command-line checking)</ h2 >
123
126
124
- < p > You can also use < code > vnu.jar</ code > from the command line to send
125
- HTML documents to a locally-running instance of the HTTP service for
126
- checking. To check documents in that way, do this:
127
-
127
+ < p > You can also use < code > vnu.jar</ code > from the command line to
128
+ either send documents to a locally-running instance of the checker HTTP
129
+ service— for fast command-line checking— or to a remote instance
130
+ anywhere on the Web.
131
+ < p >
132
+ To check documents locally, do this:
128
133
< ol >
129
-
130
- < li > Open a new terminal window and start up the markup checker as an HTTP
131
- service, as described in the
132
- "< a href ="#web-based-usage "> Web-based usage</ a > " section.
133
-
134
- < li > Open a second new terminal window and invoke < code > vnu.jar</ code >
135
- like this:
134
+ < li > Start up the checker as a local HTTP service, as described in the
135
+ < a href ="#standalone "> Standalone web server</ a >
136
+ section.
137
+ < li > Open a new terminal window and invoke < code > vnu.jar</ code > like this:
136
138
137
139
< pre >
138
140
java -cp ~/vnu.jar < span class =java-class > nu.validator.client.HttpClient</ span > FILE.html...
139
141
</ pre >
140
- </ ol >
142
+ </ ol >
143
+ To send documents to an instance of the checker on the Web, such as
144
+ < a href ="http://html5.validator.nu/ "> http://html5.validator.nu/</ a > ,
145
+ use the
146
+ < a href ="#nuvalidatorclienthost "> nu.validator.client.host</ a >
147
+ and
148
+ < a href ="#nuvalidatorclientport "> nu.validator.client.port</ a >
149
+ options, like this:
150
+ < pre class =aligned >
151
+ java < span class =java-property > -Dnu.validator.client.host=html5.validator.nu</ span > < span class =java-property > -Dnu.validator.client.port=80</ span > \
152
+ -cp ~/vnu.jar nu.validator.client.HttpClient FILE.html...
153
+ </ pre >
154
+
155
+ < p > Other options are documented below.
141
156
142
157
< h3 id ="http-client-options "> HTTP client options</ h3 >
143
158
144
- < p > When using < code > vnu.jar</ code > for sending documents to a
145
- locally-running instance of the checker HTTP service for checking,
146
- you can set Java system properties to control configuration options for the
147
- checker behavior.
159
+ < p > When using < code > vnu.jar</ code > for sending documents to an instance
160
+ of the checker HTTP service for checking, you can set Java system
161
+ properties to control configuration options for the checker behavior.
148
162
149
163
< p > For example, you can suppress warning-level messages and only
150
164
show error-level ones by setting the value of the
151
165
< code > nu.validator.client.level</ code > system property to
152
166
< code > error</ code > , like this:
153
167
154
- < pre >
168
+ < pre class = aligned >
155
169
java < span class =java-property > -Dnu.validator.client.level=error</ span > \
156
- -cp ~/vnu.jar < span class = java-class > nu.validator.client.HttpClient</ span > FILE.html...
170
+ -cp ~/vnu.jar nu.validator.client.HttpClient FILE.html...
157
171
</ pre >
158
172
159
173
< p > Most of the properties listed below map to the validator.nu common input
0 commit comments