pythondoc-elementtree.TidyTools.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  2. <html>
  3. <head>
  4. <meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
  5. <title>The elementtree.TidyTools Module</title>
  6. <link rel='stylesheet' href='effbot.css' type='text/css' />
  7. </head>
  8. <body>
  9. <h1>The elementtree.TidyTools Module</h1>
  10. <p>Tools to build element trees from HTML, using the external <b>tidy</b>
  11. utility.
  12. </p><h2>Module Contents</h2>
  13. <dl>
  14. <dt><a id='elementtree.TidyTools.getbody-function' name='elementtree.TidyTools.getbody-function'><b>getbody(file, **options)</b></a> [<a href='#elementtree.TidyTools.getbody-function'>#</a>]</dt>
  15. <dd>
  16. <p>Get document body from a an HTML or HTML-like file. This function
  17. uses the <b>tidy</b> function to convert HTML to XHTML, and cleans
  18. up the resulting XML tree.
  19. </p><dl>
  20. <dt><i>file</i></dt>
  21. <dd>
  22. Filename.</dd>
  23. <dt>Returns:</dt>
  24. <dd>
  25. A <b>body</b> element, or None if not successful.
  26. </dd>
  27. </dl><br />
  28. </dd>
  29. <dt><a id='elementtree.TidyTools.getzonebody-function' name='elementtree.TidyTools.getzonebody-function'><b>getzonebody(file, **options)</b></a> [<a href='#elementtree.TidyTools.getzonebody-function'>#</a>]</dt>
  30. <dd>
  31. <p>Same as <b>getbody</b>, but turns plain text at the start of the
  32. document into an H1 tag. This function can be used to parse zone
  33. documents.
  34. </p><dl>
  35. <dt><i>file</i></dt>
  36. <dd>
  37. Filename.</dd>
  38. <dt>Returns:</dt>
  39. <dd>
  40. A <b>body</b> element, or None if not successful.
  41. </dd>
  42. </dl><br />
  43. </dd>
  44. <dt><a id='elementtree.TidyTools.tidy-function' name='elementtree.TidyTools.tidy-function'><b>tidy(file, new_inline_tags=None)</b></a> [<a href='#elementtree.TidyTools.tidy-function'>#</a>]</dt>
  45. <dd>
  46. <p>Convert an HTML or HTML-like file to XHTML, using the <b>tidy</b>
  47. command line utility.
  48. </p><dl>
  49. <dt><i>file</i></dt>
  50. <dd>
  51. Filename.</dd>
  52. <dt><i>new_inline_tags</i></dt>
  53. <dd>
  54. An optional list of valid but non-standard
  55. inline tags.</dd>
  56. <dt>Returns:</dt>
  57. <dd>
  58. An element tree, or None if not successful.</dd>
  59. </dl><br />
  60. </dd>
  61. </dl>
  62. </body></html>