You are here

function htmltidy_help in HTML Tidy 5

Same name and namespace in other branches
  1. 6 htmltidy.module \htmltidy_help()
  2. 7 htmltidy.module \htmltidy_help()

Drupal hook that returns help text for the specified section.

Parameters

$section The section for which help is requested.:

Return value

The formatted help text.

File

./htmltidy.module, line 55

Code

function htmltidy_help($section) {
  switch ($section) {
    case 'admin/help#htmltidy':
      return t("\n        <p>\n          This module uses <a href='http://tidy.sourceforge.net/'>HTML Tidy</a>\n          to properly format HTML files. It can be used at any of several stages.\n          <ul>\n            <li>An input validator - to tidy user input as it's entered (Most efficient)</li>\n            <li>An output filter - (normal Drupal filter) which validates content just before displaying it. (cached, so pretty good)</li>\n            <li>Format the entire output of every page displayed, This will ensure your site is always 100% HTML or XHTML strict, but may be inefficient. This is the default setting</li>\n          </ul>\n          Options accepted include:\n          <ul>\n            <li>Word wrap - Specify line length (0 to disable).</li>\n            <li>Indentation - Makes HTML human-readable.</li>\n            <li>Append warnings - Outputs any feedback from Tidy to the webpage.</li>\n            <ul>\n              <li>Verbose mode - Tidy will attempt to describe warnings in detail (this is not actually\n                very helpful).</li>\n              <li>Run twice - Runs Tidy twice to get the line numbers on the warnings right.</li>\n            </ul>\n          </ul>\n        </p><p>\n          These settings are configured under the Drupal\n        <a href='?q=admin/settings/htmltidy'>Administer &gt; Settings &gt; htmltidy</a> page,\n          but the full range of HTMLTidy Options as documented\n          <a href='http://tidy.sourceforge.net/docs/quickref.html'>on the download site</a>\n          can be used if you create your own htmltidy.conf file.\n        </p><p>\n          Several permissions are also settable in the access control panel:\n          <ul>\n            <li>administer htmltidy - Self-explanatory.</li>\n            <li>use htmltidy debug mode - Append warnings as mentioned above.</li>\n            <li>use htmltidy on output - This lets you turn htmltidy off to save proc time for user\n             who will probably not be looking at source and to save bandwidth and processor time.</li>\n          </ul>\n        </p><p>\n          There appear to be issues with the input validator conflicting with\n          other rewrite filters, this hasn't been fully investigated yet.\n        </p><p>\n          Due to forking (or lack of it) under Windows platforms, you may see flickers of\n          DOS boxes as the application is run. This depends a lot on how your server was configured\n          (service or commandline app). This can be ignored.\n        </p>\n      ");
      break;
    case 'admin/modules#description':
      return t("\n        Repairs, indents and wraps HTML. Also gives debugging information about\n        spec-conformance. Can be used as a complete site-wrapper, input\n        validator, or an output filter.\n      ");
      break;
    case 'admin/settings/htmltidy':
      return t("\n          <p>\n            Here you can set up HTML tidying options.\n            This allows you to clean up the HTML that Drupal emits,\n            with indenting and word-wrapping options.\n          </p><p>\n            The recommended way of using the HTMLTidy module is to apply it as a\n            <em>validator</em> over <em>input</em>.\n            This means that invalid HTML never even makes it into the system.\n            To force compliance on an existing website however,\n            you may need to enable the <em>output</em> filter instead.\n            This approach will tidy the entire page every time.\n            An alternative solution is to use HTMLTidy as an output filter.\n            This means that the contents of nodes will be validated and cached\n            before display, but not the entire page.\n          </p>\n      ");
      break;
  }
  return t($output);
}