Posted By

mitry on 06/10/09


Tagged

html tidy


Versions (?)

~/.tidyrc


 / Published in: Other
 

URL: http://tidy.sourceforge.net/docs/quickref.html

  1. // @(#) HTML Tidy Configuration Options
  2.  
  3. // HTML, XHTML, XML Options Reference {{{1
  4.  
  5. // add-xml-decl: no
  6. // This option specifies if Tidy should add the XML declaration when
  7. // outputting XML or XHTML. Note that if the input already includes an
  8. // <?xml ... ?> declaration then this option will be ignored.
  9. // If the encoding for the output is different from "ascii", one of
  10. // the utf encodings or "raw", the declaration is always added as
  11. // required by the XML standard.
  12.  
  13. // add-xml-space: no
  14. // This option specifies if Tidy should add xml:space="preserve" to elements
  15. // such as <PRE>, <STYLE> and <SCRIPT> when generating XML. This is needed if
  16. // the whitespace in such elements is to be parsed appropriately without having
  17. // access to the DTD.
  18.  
  19. // alt-text: String
  20. // This option specifies the default "alt=" text Tidy uses for <IMG>
  21. // attributes. This feature is dangerous as it suppresses further accessibility
  22. // warnings. You are responsible for making your documents accessible to people
  23. // who can not see the images!
  24.  
  25. // anchor-as-name: yes
  26. // This option controls the deletion or addition of the name attribute in
  27. // elements where it can serve as anchor. If set to "yes", a name attribute, if
  28. // not already existing, is added along an existing id attribute if the DTD
  29. // allows it. If set to "no", any existing name attribute is removed if an id
  30. // attribute exists or has been added.
  31.  
  32. // assume-xml-procins: yes
  33. // This option specifies if Tidy should change the parsing of processing
  34. // instructions to require ?> as the terminator rather than >. This option is
  35. // automatically set if the input is in XML.
  36.  
  37. bare: yes
  38. // This option specifies if Tidy should strip Microsoft specific HTML from Word
  39. // 2000 documents, and output spaces rather than non-breaking spaces where they
  40. // exist in the input.
  41.  
  42. clean: yes
  43. // This option specifies if Tidy should strip out surplus presentational tags
  44. // and attributes replacing them by style rules and structural markup as
  45. // appropriate. It works well on the HTML saved by Microsoft Office products.
  46.  
  47. // css-prefix: String
  48. // This option specifies the prefix that Tidy uses for styles rules.
  49. // By default, "c" will be used.
  50.  
  51. // decorate-inferred-ul: no
  52. // This option specifies if Tidy should decorate inferred UL elements with some
  53. // CSS markup to avoid indentation to the right.
  54.  
  55. // doctype: auto
  56. // Example: omit, auto, strict, transitional, user
  57. // This option specifies the DOCTYPE declaration generated by Tidy. If set to
  58. // "omit" the output won't contain a DOCTYPE declaration. If set to "auto" (the
  59. // default) Tidy will use an educated guess based upon the contents of the
  60. // document. If set to "strict", Tidy will set the DOCTYPE to the strict DTD.
  61. // If set to "loose", the DOCTYPE is set to the loose (transitional) DTD.
  62. // Alternatively, you can supply a string for the formal public identifier
  63. // (FPI).
  64. //
  65. // For example:
  66. // doctype: "-//ACME//DTD HTML 3.14159//EN"
  67. //
  68. // If you specify the FPI for an XHTML document, Tidy will set the system
  69. // identifier to an empty string. For an HTML document, Tidy adds a system
  70. // identifier only if one was already present in order to preserve the
  71. // processing mode of some browsers. Tidy leaves the DOCTYPE for generic XML
  72. // documents unchanged. --doctype omit implies --numeric-entities yes. This
  73. // option does not offer a validation of the document conformance.
  74.  
  75. // drop-empty-paras: yes
  76. // This option specifies if Tidy should discard empty paragraphs.
  77.  
  78. drop-font-tags: yes
  79. // This option specifies if Tidy should discard <FONT> and <CENTER> tags
  80. // without creating the corresponding style rules. This option can be set
  81. // independently of the clean option.
  82.  
  83. drop-proprietary-attributes: yes
  84. // This option specifies if Tidy should strip out proprietary attributes, such
  85. // as MS data binding attributes.
  86.  
  87. // enclose-block-text: no
  88. // This option specifies if Tidy should insert a <P> element to enclose any
  89. // text it finds in any element that allows mixed content for HTML transitional
  90. // but not HTML strict.
  91.  
  92. // enclose-text: no
  93. // This option specifies if Tidy should enclose any text it finds in the body
  94. // element within a <P> element. This is useful when you want to take existing
  95. // HTML and use it with a style sheet.
  96.  
  97. // escape-cdata: no
  98. // This option specifies if Tidy should convert <![CDATA[]]> sections to normal text.
  99.  
  100. // fix-backslash: yes
  101. // This option specifies if Tidy should replace backslash characters "\" in
  102. // URLs by forward slashes "/".
  103.  
  104. // fix-bad-comments: yes
  105. // This option specifies if Tidy should replace unexpected hyphens with "="
  106. // characters when it comes across adjacent hyphens. The default is yes. This
  107. // option is provided for users of Cold Fusion which uses the comment syntax:
  108. // <!--- --->
  109.  
  110. // fix-uri: yes
  111. // This option specifies if Tidy should check attribute values that carry URIs
  112. // for illegal characters and if such are found, escape them as HTML
  113. // 4 recommends.
  114.  
  115. // hide-comments: no
  116. // This option specifies if Tidy should print out comments.
  117.  
  118. hide-endtags: yes
  119. // This option specifies if Tidy should omit optional end-tags when generating
  120. // the pretty printed markup.
  121. // This option is ignored if you are outputting to XML.
  122.  
  123. // indent-cdata: no
  124. // This option specifies if Tidy should indent <![CDATA[]]> sections.
  125.  
  126. // input-xml: no
  127. // This option specifies if Tidy should use the XML parser rather than the
  128. // error correcting HTML parser.
  129.  
  130. // join-classes: no
  131. // This option specifies if Tidy should combine class names to generate
  132. // a single new class name, if multiple class assignments are detected on an
  133. // element.
  134.  
  135. // join-styles: yes
  136. // This option specifies if Tidy should combine styles to generate a single new
  137. // style, if multiple style values are detected on an element.
  138.  
  139. // literal-attributes: no
  140. // This option specifies if Tidy should ensure that whitespace characters
  141. // within attribute values are passed through unchanged.
  142.  
  143. // logical-emphasis: no
  144. // This option specifies if Tidy should replace any occurrence of <I> by <EM>
  145. // and any occurrence of <B> by <STRONG>. In both cases, the attributes are
  146. // preserved unchanged. This option can be set independently of the clean and
  147. // drop-font-tags options.
  148.  
  149. // lower-literals: yes
  150. // This option specifies if Tidy should convert the value of an attribute that
  151. // takes a list of predefined values to lower case. This is required for XHTML
  152. // documents.
  153.  
  154. // merge-divs: auto
  155. // Can be used to modify behavior of -c (--clean yes) option. This option
  156. // specifies if Tidy should merge nested <div> such as
  157. // "<div><div>...</div></div>". If set to "auto", the attributes of the inner
  158. // <div> are moved to the outer one. As well, nested <div> with ID attributes
  159. // are not merged. If set to "yes", the attributes of the inner <div> are
  160. // discarded with the exception of "class" and "style".
  161.  
  162. // merge-spans: auto
  163. // Can be used to modify behavior of -c (--clean yes) option. This option
  164. // specifies if Tidy should merge nested <span> such as
  165. // "<span><span>...</span></span>". The algorithm is identical to the one used
  166. // by --merge-divs.
  167.  
  168. // ncr: yes
  169. // This option specifies if Tidy should allow numeric character references.
  170.  
  171. // new-blocklevel-tags:
  172. // Space or comma separated list of tag names. Unless you declare new tags,
  173. // Tidy will refuse to generate a tidied file if the input includes previously
  174. // unknown tags. Note you can't change the content model for elements such as
  175. // <TABLE>, <UL>, <OL> and <DL>. This option is ignored in XML mode.
  176. //
  177. // Example: tagX, tagY, ... new-empty-tags
  178.  
  179. // new-empty-tags:
  180. // Space or comma separated list of tag names. Unless you declare new tags,
  181. // Tidy will refuse to generate a tidied file if the input includes previously
  182. // unknown tags. Remember to also declare empty tags as either inline or
  183. // blocklevel. This option is ignored in XML mode.
  184. //
  185. // Example: tagX, tagY, ... new-blocklevel-tags
  186.  
  187. // new-inline-tags:
  188. // Space or comma separated list of tag names. Unless you declare new tags,
  189. // Tidy will refuse to generate a tidied file if the input includes previously
  190. // unknown tags. This option is ignored in XML mode.
  191. //
  192. // Example: tagX, tagY, ... new-blocklevel-tags
  193.  
  194. // new-pre-tags:
  195. // This option specifies new tags that are to be processed in exactly the same
  196. // way as HTML's <PRE> element. This option takes a space or comma separated
  197. // list of tag names. Unless you declare new tags, Tidy will refuse to generate
  198. // a tidied file if the input includes previously unknown tags. Note you can
  199. // not as yet add new CDATA elements (similar to <SCRIPT>). This option is
  200. // ignored in XML mode.
  201. //
  202. // Example: tagX, tagY, ... new-blocklevel-tags
  203.  
  204. // numeric-entities: no
  205. // This option specifies if Tidy should output entities other than the built-in
  206. // HTML entities (&amp;, &lt;, &gt; and &quot;) in the numeric rather than the
  207. // named entity form. Only entities compatible with the DOCTYPE declaration
  208. // generated are used. Entities that can be represented in the output encoding
  209. // are translated correspondingly.
  210.  
  211. // output-html: no
  212. // This option specifies if Tidy should generate pretty printed output,
  213. // writing it as HTML.
  214.  
  215. // output-xhtml: no
  216. // This option specifies if Tidy should generate pretty printed output, writing
  217. // it as extensible HTML. This option causes Tidy to set the DOCTYPE and
  218. // default namespace as appropriate to XHTML. If a DOCTYPE or namespace is
  219. // given they will checked for consistency with the content of the document. In
  220. // the case of an inconsistency, the corrected values will appear in the
  221. // output. For XHTML, entities can be written as named or numeric entities
  222. // according to the setting of the "numeric-entities" option. The original case
  223. // of tags and attributes will be preserved, regardless of other options.
  224.  
  225. // output-xml: no
  226. // This option specifies if Tidy should pretty print output, writing it as
  227. // well-formed XML. Any entities not defined in XML 1.0 will be written as
  228. // numeric entities to allow them to be parsed by a XML parser. The original
  229. // case of tags and attributes will be preserved, regardless of other options.
  230.  
  231. preserve-entities: yes
  232. // This option specifies if Tidy should preserve the well-formed entitites as
  233. // found in the input.
  234.  
  235. // quote-ampersand: yes
  236. // This option specifies if Tidy should output unadorned & characters as &amp;.
  237.  
  238. // quote-marks: no
  239. // This option specifies if Tidy should output " characters as &quot; as is
  240. // preferred by some editing environments. The apostrophe character ' is
  241. // written out as &#39; since many web browsers don't yet support &apos;.
  242.  
  243. // quote-nbsp: yes
  244. // This option specifies if Tidy should output non-breaking space characters as
  245. // entities, rather than as the Unicode character value 160 (decimal).
  246.  
  247. // repeated-attributes: keep-last
  248. // This option specifies if Tidy should keep the first or last attribute, if an
  249. // attribute is repeated, e.g. has two align attributes.
  250. //
  251. // Example: keep-first, keep-last
  252.  
  253. replace-color: yes
  254. // replace-color: no
  255. // This option specifies if Tidy should replace numeric values in color
  256. // attributes by HTML/XHTML color names where defined,
  257. // e.g. replace "#ffffff" with "white".
  258.  
  259. // show-body-only: no
  260. // This option specifies if Tidy should print only the contents of the body tag
  261. // as an HTML fragment. If set to "auto", this is performed only if the body
  262. // tag has been inferred. Useful for incorporating existing whole pages as
  263. // a portion of another page. This option has no effect if XML output is
  264. // requested.
  265.  
  266. // uppercase-attributes: no
  267. // This option specifies if Tidy should output attribute names in upper case.
  268. // The default is no, which results in lower case attribute names, except for
  269. // XML input, where the original case is preserved.
  270.  
  271. // uppercase-tags: no
  272. // This option specifies if Tidy should output tag names in upper case. The
  273. // default is no, which results in lower case tag names, except for XML input,
  274. // where the original case is preserved.
  275.  
  276. word-2000: yes
  277. // word-2000: no
  278. // This option specifies if Tidy should go to great pains to strip out all the
  279. // surplus stuff Microsoft Word 2000 inserts when you save Word documents as
  280. // "Web pages". Doesn't handle embedded images or VML. You should consider
  281. // using Word's "Save As: Web Page, Filtered".
  282.  
  283. // Diagnostics Options Reference {{{1
  284.  
  285. // accessibility-check:
  286. // This option specifies what level of accessibility checking, if any, that
  287. // Tidy should do. Level 0 is equivalent to Tidy Classic's accessibility
  288. // checking. For more information on Tidy's accessibility checking, visit the
  289. // Adaptive Technology Resource Centre at the University of Toronto.
  290. //
  291. // Example: 0 (Tidy Classic), 1 (Priority 1 Checks),
  292. // 2 (Priority 2 Checks), 3 (Priority 3 Checks)
  293.  
  294. // show-errors: 6
  295. // This option specifies the number Tidy uses to determine if further errors
  296. // should be shown. If set to 0, then no errors are shown.
  297.  
  298. // show-warnings: yes
  299. // This option specifies if Tidy should suppress warnings. This can be useful
  300. // when a few errors are hidden in a flurry of warnings.
  301.  
  302. // Pretty Print Options Reference {{{1
  303.  
  304. // break-before-br: no
  305. // This option specifies if Tidy should output a line break before each <BR> element.
  306.  
  307. indent: auto
  308. // indent: no
  309. // This option specifies if Tidy should indent block-level tags. If set to
  310. // "auto", this option causes Tidy to decide whether or not to indent the
  311. // content of tags such as TITLE, H1-H6, LI, TD, TD, or P depending on whether
  312. // or not the content includes a block-level element. You are advised to avoid
  313. // setting indent to yes as this can expose layout bugs in some browsers.
  314.  
  315. // indent-attributes: no
  316. // This option specifies if Tidy should begin each attribute on a new line.
  317.  
  318. indent-spaces: 8
  319. // indent-spaces: 2
  320. // This option specifies the number of spaces Tidy uses to indent content,
  321. // when indentation is enabled.
  322.  
  323. // markup: yes
  324. // This option specifies if Tidy should generate a pretty printed version of
  325. // the markup. Note that Tidy won't generate a pretty printed version if it
  326. // finds significant errors (see force-output).
  327.  
  328. punctuation-wrap: yes
  329. // punctuation-wrap:no
  330. // This option specifies if Tidy should line wrap after some Unicode or Chinese
  331. // punctuation characters.
  332.  
  333. // sort-attributes: none
  334. // This option specifies that tidy should sort attributes within an element
  335. // using the specified sort algorithm. If set to "alpha", the algorithm is an
  336. // ascending alphabetic sort.
  337. //
  338. // Example: none, alpha
  339.  
  340. // split: no
  341. // Currently not used. Tidy Classic only.
  342.  
  343. // tab-size: 8
  344. // This option specifies the number of columns that Tidy uses between
  345. // successive tab stops. It is used to map tabs to spaces when reading the
  346. // input. Tidy never outputs tabs.
  347.  
  348. vertical-space: yes
  349. // This option specifies if Tidy should add some empty lines for readability.
  350.  
  351. wrap: 0
  352. // wrap: 68
  353. // This option specifies the right margin Tidy uses for line wrapping. Tidy
  354. // tries to wrap lines so that they do not exceed this length.
  355. // Set wrap to zero if you want to disable line wrapping.
  356.  
  357. // wrap-asp: yes
  358. // This option specifies if Tidy should line wrap text contained within ASP
  359. // pseudo elements, which look like: <% ... %>.
  360.  
  361. // wrap-attributes: no
  362. // This option specifies if Tidy should line wrap attribute values, for easier
  363. // editing. This option can be set independently of wrap-script-literals.
  364.  
  365. // wrap-jste: yes
  366. // This option specifies if Tidy should line wrap text contained within JSTE
  367. // pseudo elements, which look like: <# ... #>.
  368.  
  369. // wrap-php: yes
  370. // This option specifies if Tidy should line wrap text contained within PHP
  371. // pseudo elements, which look like: <?php ... ?>.
  372.  
  373. // wrap-script-literals: no
  374. // This option specifies if Tidy should line wrap string literals that appear
  375. // in script attributes. Tidy wraps long script string literals by inserting
  376. // a backslash character before the line break.
  377.  
  378. // wrap-sections: yes
  379. // This option specifies if Tidy should line wrap text contained
  380. // within <![ ... ]> section tags.
  381.  
  382. // Character Encoding Options Reference {{{1
  383.  
  384. // ascii-chars: no
  385. // Can be used to modify behavior of -c (--clean yes) option.
  386. // If set to "yes" when using -c, &emdash;, &rdquo;, and other named character
  387. // entities are downgraded to their closest ascii equivalents.
  388.  
  389. char-encoding: raw
  390. // char-encoding: ascii
  391. // This option specifies the character encoding Tidy uses for both the input
  392. // and output. For ascii, Tidy will accept Latin-1 (ISO-8859-1) character
  393. // values, but will use entities for all characters whose value > 127. For raw,
  394. // Tidy will output values above 127 without translating them into entities.
  395. // For latin1, characters above 255 will be written as entities. For utf8, Tidy
  396. // assumes that both input and output is encoded as UTF-8. You can use iso2022
  397. // for files encoded using the ISO-2022 family of encodings e.g. ISO-2022-JP.
  398. // For mac and win1252, Tidy will accept vendor specific character values, but
  399. // will use entities for all characters whose value > 127. For unsupported
  400. // encodings, use an external utility to convert to and from UTF-8.
  401. //
  402. // Example: raw, ascii, latin0, latin1, utf8, iso2022, mac, win1252,
  403. // ibm858, utf16le, utf16be, utf16, big5, shiftjis
  404.  
  405. // input-encoding:latin1
  406. // This option specifies the character encoding Tidy uses for the input. See
  407. // char-encoding for more info.
  408. //
  409. // Example: raw, ascii, latin0, latin1, utf8, iso2022, mac, win1252,
  410. // ibm858, utf16le, utf16be, utf16, big5, shiftjis
  411.  
  412. language: ru
  413. // Currently not used, but this option specifies the language Tidy uses
  414. // (for instance "en").
  415.  
  416. // newline:
  417. // The default is appropriate to the current platform: CRLF on PC-DOS,
  418. // MS-Windows and OS/2, CR on Classic Mac OS, and LF everywhere else (Unix and
  419. // Linux).
  420. // Default: Platform dependent
  421.  
  422. // output-bom: auto
  423. // This option specifies if Tidy should write a Unicode Byte Order Mark
  424. // character (BOM; also known as Zero Width No-Break Space; has value of
  425. // U+FEFF) to the beginning of the output; only for UTF-8 and UTF-16 output
  426. // encodings. If set to "auto", this option causes Tidy to write a BOM to the
  427. // output only if a BOM was present at the beginning of the input. A BOM is
  428. // always written for XML/XHTML output using UTF-16 output encodings.
  429.  
  430. // output-encoding: ascii
  431. // This option specifies the character encoding Tidy uses for the output. See
  432. // char-encoding for more info. May only be different from input-encoding for
  433. // Latin encodings (ascii, latin0, latin1, mac, win1252, ibm858).
  434. //
  435. // Example: raw, ascii, latin0, latin1, utf8, iso2022, mac, win1252,
  436. // ibm858, utf16le, utf16be, utf16, big5, shiftjis
  437.  
  438. // Miscellaneous Options Reference {{{1
  439.  
  440. // error-file: -
  441. // This option specifies the error file Tidy uses for errors and warnings.
  442. // Normally errors and warnings are output to "stderr".
  443.  
  444. // force-output: no
  445. // This option specifies if Tidy should produce output even if errors are
  446. // encountered. Use this option with care - if Tidy reports an error, this
  447. // means Tidy was not able to, or is not sure how to, fix the error, so the
  448. // resulting output may not reflect your intention.
  449.  
  450. gnu-emacs: yes
  451. // This option specifies if Tidy should change the format for reporting errors
  452. // and warnings to a format that is more easily parsed by GNU Emacs.
  453.  
  454. // gnu-emacs-file: -
  455. // Used internally.
  456.  
  457. // keep-time: no
  458. // This option specifies if Tidy should keep the original modification time of
  459. // files that Tidy modifies in place. The default is no. Setting the option to
  460. // yes allows you to tidy files without causing these files to be uploaded to
  461. // a web server when using a tool such as SiteCopy. Note this feature is not
  462. // supported on some platforms.
  463.  
  464. // output-file: -
  465. // This option specifies the output file Tidy uses for markup. Normally markup
  466. // is written to "stdout".
  467.  
  468. // quiet: no
  469. // This option specifies if Tidy should output the summary of the numbers of
  470. // errors and warnings, or the welcome or informational messages.
  471.  
  472. // slide-style: -
  473. // Currently not used. Tidy Classic only.
  474.  
  475. // tidy-mark: yes
  476. // This option specifies if Tidy should add a meta element to the document head
  477. // to indicate that the document has been tidied. Tidy won't add a meta element
  478. // if one is already present.
  479.  
  480. // write-back: no
  481. // This option specifies if Tidy should write back the tidied markup to the
  482. // same file it read from. You are advised to keep copies of important files
  483. // before tidying them, as on rare occasions the result may not be what you
  484. // expect.

Report this snippet  

You need to login to post a comment.