Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.tox
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In order to use this tool to render wikitext into HTML in a Python program, you
source += line

wiki_content = wiki2html(source, True)
print wiki_content
print(wiki_content)


Doc about Syntax
Expand Down
4 changes: 3 additions & 1 deletion mediawiki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

"""

from wiki import *
from __future__ import unicode_literals
from __future__ import absolute_import
from .wiki import *

__author__ = "Raimon Esteve <resteve@zikzakmedia.com"
__license__ = "GPLv3+"
Expand Down
8 changes: 7 additions & 1 deletion mediawiki/doc/generate_syntax_demo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
from mediawiki import *
from io import open
import six

source = ''
with open("syntax") as f:
for line in f:
source += line

wiki_content = wiki2html(source, True)
print wiki_content
output_fn = six.ensure_binary if six.PY2 else six.ensure_text
print(output_fn(wiki_content))
4 changes: 3 additions & 1 deletion mediawiki/doc/syntax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
==Basic Wiki Editing==
==Basic Wiki Ëditing==
You can ''italicize text'' by putting 2
apostrophes on each side.
3 apostrophes will embolden '''the text'''.
Expand All @@ -18,6 +18,8 @@ apostrophes on each side.

(4 apostrophes don't do anything special -- there's just ''''one left over''''.)

unicodË

==Links==

You can give link to the other Web page over the Internet easily [http://google.com Visit Google]
Expand Down
7 changes: 4 additions & 3 deletions mediawiki/doc/syntax.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="toc"><h2>Table of Contents</h2>
<ul>
<li class="toclevel-1"><a href="#w_basic-wiki-editing"><span class="tocnumber">1</span> <span class="toctext">Basic Wiki Editing</span></a></li>
<li class="toclevel-1"><a href="#w_basic-wiki-editing"><span class="tocnumber">1</span> <span class="toctext">Basic Wiki Ëditing</span></a></li>
<li class="toclevel-1"><a href="#w_links"><span class="tocnumber">2</span> <span class="toctext">Links</span></a></li>
<li class="toclevel-1"><a href="#w_attachments"><span class="tocnumber">3</span> <span class="toctext">Attachments</span></a>
<ul>
Expand All @@ -23,7 +23,7 @@
</ul>
</li>
</ul>
</div><h2 id="w_basic-wiki-editing">Basic Wiki Editing</h2>
</div><h2 id="w_basic-wiki-editing">Basic Wiki Ëditing</h2>
<p>You can <i>italicize text</i> by putting 2
apostrophes on each side.
3 apostrophes will embolden <b>the text</b>.
Expand All @@ -38,6 +38,7 @@
</p><p>5 apostrophes will embolden and italicize
<i><b>the text</b></i>.
</p><p>(4 apostrophes don't do anything special -- there's just '<b>one left over'</b>.)
</p><p>unicodË
</p>
<h2 id="w_links">Links</h2>
<p>You can give link to the other Web page over the Internet easily <a href="http://google.com" alt="Visit Google">Visit Google</a>
Expand Down Expand Up @@ -102,7 +103,7 @@ <h2 id="w_table">Table</h2>
|}

</p>
<table cellpadding="5" border="1" align="left" cellspacing="0">
<table border="1" cellspacing="0" cellpadding="5" align="left">
<tr>
<th> Web site
</th><th> Link
Expand Down
10 changes: 3 additions & 7 deletions mediawiki/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@

"""

from __future__ import unicode_literals
from __future__ import absolute_import
import re
import random
import locale

from base64 import b64encode
from base64 import b64decode
from StringIO import StringIO

import wikimarkup
from . import wikimarkup

_image = re.compile(r'img:(.*)\.(.*)', re.UNICODE)
_attach = re.compile(r'attach:(.*)\.(.*)', re.UNICODE)
Expand Down
Loading