File: README.rst

package info (click to toggle)
utidylib 0.10-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 216 kB
  • sloc: python: 428; makefile: 148; sh: 41
file content (68 lines) | stat: -rw-r--r-- 1,841 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
uTidylib
========

.. image:: https://github.com/nijel/utidylib/actions/workflows/test.yml/badge.svg
    :target: https://github.com/nijel/utidylib/actions/workflows/test.yml
    :alt: Build Status

.. image:: https://codecov.io/gh/nijel/utidylib/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/nijel/utidylib
    :alt: Coverage Status

.. image:: https://readthedocs.org/projects/utidylib/badge/?version=latest
    :target: http://utidylib.readthedocs.org/en/latest/
    :alt: Documentation

.. image:: https://img.shields.io/pypi/v/uTidylib
   :target: https://pypi.org/project/uTidylib/
   :alt: PyPI - Version


This is uTidylib, the Python wrapper for the HTML cleaning
library named TidyLib. It supports both original Tidy <http://tidy.sf.net> and new
HTML5 enabled Tidy <http://www.html-tidy.org/>.

The package is available on PyPI <https://pypi.org/project/uTidylib/>.

Once installed, there are two ways to get help.  The simplest is:

.. code-block:: sh

    $ python
    >>> import tidy
    >>> help(tidy)
    . . .

Then, of course, there's the API documentation, which
is available at <https://utidylib.readthedocs.io/en/latest/>.

10 Second Tutorial
------------------

.. code-block:: pycon

    >>> import tidy
    >>> print(
    ...     tidy.parseString(
    ...         "<Html>Hello Tidy!",
    ...         output_xhtml=1,
    ...         add_xml_decl=1,
    ...         indent=1,
    ...         tidy_mark=0,
    ...         doctype="transitional",
    ...     )
    ... )
    <?xml version="1.0"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title></title>
      </head>
      <body>
        Hello Tidy!
      </body>
    </html>


Good luck!