Added show-info option. Fixes #6.

This commit is contained in:
Michael[tm] Smith 2012-04-02 16:41:05 +09:00
parent 880221e26d
commit d194e8726e
6 changed files with 34 additions and 2 deletions

View file

@ -108,6 +108,7 @@ typedef enum
TidyOutFile, /**< File name to write markup to */
TidyWriteBack, /**< If true then output tidied markup */
TidyShowMarkup, /**< If false, normal output is suppressed */
TidyShowInfo, /**< If true, info-level messages are shown */
TidyShowWarnings, /**< However errors are always shown */
TidyQuiet, /**< No 'Parsing X', guessed DTD or summary */
TidyIndentContent, /**< Indent content of appropriate tags */

View file

@ -376,6 +376,7 @@ configuration options:
<li><a href="http://w3c.github.com/tidy-html5/quickref.html#drop-empty-elements">drop-empty-elements</a>
<li><a href="http://w3c.github.com/tidy-html5/quickref.html#merge-emphasis">merge-emphasis</a>
<li><a href="http://w3c.github.com/tidy-html5/quickref.html#omit-optional-tags">omit-optional-tags</a>
<li><a href="http://w3c.github.com/tidy-html5/quickref.html#show-info">show-info</a>
</ul>
<p>In addition, it also adds a new <code>html5</code> value for the
<a href="http://w3c.github.com/tidy-html5/quickref.html#doctype">doctype</a>

View file

@ -8,7 +8,7 @@
<body>
<h1 id="top">Quick Reference</h1>
<h2>HTML Tidy Configuration Options</h2>
<p>Version: <a href="https://github.com/w3c/tidy-html5/tree/abc1e3f">https://github.com/w3c/tidy-html5/tree/abc1e3f</a></p>
<p>Version: <a href="https://github.com/w3c/tidy-html5/tree/1f21625">https://github.com/w3c/tidy-html5/tree/1f21625</a></p>
<p>
<a class="h3" href="#MarkupHeader">HTML, XHTML, XML</a>
<br />
@ -448,6 +448,13 @@
<td>Integer</td>
<td>6</td>
</tr>
<tr>
<td>
<a href="#show-info">show-info</a>
</td>
<td>Boolean</td>
<td>yes</td>
</tr>
<tr>
<td>
<a href="#show-warnings">show-warnings</a>
@ -1763,6 +1770,23 @@
<tr>
<td>&#160;</td>
</tr>
<tr>
<td class="tabletitle" valign="top" id="show-info">show-info</td>
<td class="tabletitlelink" valign="top" align="right">
<a href="#top">Top</a>
</td>
</tr>
<tr>
<td valign="top">Type: <strong>Boolean</strong><br />
Default: <strong>yes</strong><br />Example: <strong>y/n, yes/no, t/f, true/false, 1/0</strong></td>
<td align="right" valign="top"></td>
</tr>
<tr>
<td colspan="2">This option specifies if Tidy should display info-level messages. </td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<tr>
<td class="tabletitle" valign="top" id="show-warnings">show-warnings</td>
<td class="tabletitlelink" valign="top" align="right">

View file

@ -236,6 +236,7 @@ static const TidyOptionImpl option_defs[] =
{ TidyOutFile, MS, "output-file", ST, 0, ParseString, NULL },
{ TidyWriteBack, MS, "write-back", BL, no, ParseBool, boolPicks },
{ TidyShowMarkup, PP, "markup", BL, yes, ParseBool, boolPicks },
{ TidyShowInfo, DG, "show-info", BL, yes, ParseBool, boolPicks },
{ TidyShowWarnings, DG, "show-warnings", BL, yes, ParseBool, boolPicks },
{ TidyQuiet, MS, "quiet", BL, no, ParseBool, boolPicks },
{ TidyIndentContent, PP, "indent", IN, TidyNoState, ParseAutoBool, autoBoolPicks },

View file

@ -681,6 +681,9 @@ static const TidyOptionDoc option_docs[] =
"This option specifies the number Tidy uses to determine if further errors "
"should be shown. If set to 0, then no errors are shown. "
},
{TidyShowInfo,
"This option specifies if Tidy should display info-level messages. "
},
{TidyShowWarnings,
"This option specifies if Tidy should suppress warnings. This can be "
"useful when a few errors are hidden in a flurry of warnings. "
@ -1083,6 +1086,7 @@ __attribute__((format(printf, 2, 3)))
void message( TidyDocImpl* doc, TidyReportLevel level, ctmbstr msg, ... )
{
if (level == TidyInfo && !cfgBool(doc, TidyShowInfo)) return;
va_list args;
va_start( args, msg );
messagePos( doc, level, 0, 0, msg, args );
@ -1812,6 +1816,7 @@ void TY_(NeedsAuthorIntervention)( TidyDocImpl* doc )
void TY_(GeneralInfo)( TidyDocImpl* doc )
{
if (!cfgBool(doc, TidyShowInfo)) return;
tidy_out(doc, "About this fork of Tidy: http://w3c.github.com/tidy-html5/\n");
tidy_out(doc, "Bug reports and comments: https://github.com/w3c/tidy-html5/issues/\n");
tidy_out(doc, "Or send questions and comments to html-tidy@w3.org\n");

View file

@ -1 +1 @@
static const char TY_(release_date)[] = "https://github.com/w3c/tidy-html5/tree/1f21625";
static const char TY_(release_date)[] = "https://github.com/w3c/tidy-html5/tree/880221e";