OSDN Git Service

Initial commit
[wordring-tm/wordring-tm.git] / third_party / tidy-html5-master / build / documentation / pages / page_tidy_scripting.dox
1 /*!
2
3 \page tidy_scripting Running tidy in scripts
4
5 If you want to run Tidy from a Perl, bash, or other scripting language you may find it of value to inspect the result returned 
6 by Tidy when it exits: 
7
8 - \b 0 = if everything is fine
9 - \b 1 = if there were warnings and 
10 - \b 2 = if there were errors. 
11
12 \section perl_example_script Example Perl script
13
14 \code{.pl}
15 if (close(TIDY) == 0) {
16   my $exitcode = $? >> 8;
17   if ($exitcode == 1) {
18     printf STDERR "tidy issued warning messages\n";
19   } elsif ($exitcode == 2) {
20     printf STDERR "tidy issued error messages\n";
21   } else {
22     die "tidy exited with code: $exitcode\n";
23   }
24 } else {
25   printf STDERR "tidy detected no errors\n";
26 }
27 \endcode
28
29
30
31 */