summaryrefslogtreecommitdiff
path: root/test2.py
blob: 975c1da464dc897b862fb44765a909bfde3b2393 (plain)
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
69
70
71
72
73
74
75
76
77
78
79

from tests.utils.utils import make_diff
from creole import html2creole, creole2html, html2rest
from creole.rest2html.clean_writer import rest2html

source = """\
Text before table without headlines:

| ///var/www/YourSite///**media**/            | //Static media files//
| ///var/www/YourSite///**local_settings.py** | //[[/permalink/332/a-complete-local_settingspy-example|your own settings]]//
| ///var/www/YourSite///**manage.py**         | //Access to django cli management//

[[/path/to/foo|bar]] link at the end.
"""

source = """\
                +---------------------------+
                | * foo `table item`_ bar 1 |
                | * foo `table item`_ bar 2 |
                +---------------------------+
                
                .. _table item: foo/bar
"""
source = """\
* foo `table item 1 <foo/bar/1/>`_ bar 1
* foo `table item 2 <foo/bar/2/>`_ bar 2
"""


#"""
#<ul>
#    <li><p>item 1</p>
#        <ul>
#            <li><p>subitem 1.1</p>
#                <ul>
#                    <li>subsubitem 1.1.1</li>
#                    <li>subsubitem 1.1.2</li>
#                </ul>
#            </li>
#            <li><p>subitem 1.2</p>
#            </li>
#        </ul>
#    </li>
#    <li><p>item 2</p>
#        <ul>
#            <li>subitem 2.1</li>
#        </ul>
#    </li>
#</ul>
#"""

#html = creole2html(source)

source += "\n"
html = rest2html(source)

print("_" * 79)
print(html)
print("=" * 79)

#creole = html2creole(html)
#print("_" * 79)
#print(creole)
#print("=" * 79)

#html2 = creole2html(creole)
#print("_" * 79)
#print(html2)
#print("=" * 79)

rest2 = html2rest(html)

print("_" * 79)
print(rest2)
print("=" * 79)

#print("_" * 79)
#print(make_diff(source, rest2))
#print("=" * 79)