Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
lets not change wiki
  • Loading branch information
ralsina committed Aug 16, 2016
1 parent f5010ff commit 5e8a205
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion v7/wiki/requirements.txt
@@ -1 +1 @@
nxcreole
creole
2 changes: 1 addition & 1 deletion v7/wiki/wiki.plugin
Expand Up @@ -4,7 +4,7 @@ Module = wiki

[Documentation]
Author = Roberto Alsina
Version = 0.3
Version = 0.2
Website = http://plugins.getnikola.com/#wiki
Description = Compile WikiMarkup into HTML

13 changes: 8 additions & 5 deletions v7/wiki/wiki.py
Expand Up @@ -30,9 +30,11 @@
import os

try:
import nxcreole
from creole import Parser
from creole.html_emitter import HtmlEmitter
creole = True
except ImportError:
nxcreole = None
creole = None

from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing
Expand All @@ -46,13 +48,14 @@ class CompileWiki(PageCompiler):
supports_onefile = False

def compile_html(self, source, dest, is_two_file=True):
if nxcreole is None:
req_missing(['nxcreole'], 'build this site (compile CreoleWiki)')
if creole is None:
req_missing(['creole'], 'build this site (compile CreoleWiki)')
makedirs(os.path.dirname(dest))
with codecs.open(dest, "w+", "utf8") as out_file:
with codecs.open(source, "r", "utf8") as in_file:
data = in_file.read()
output = nxcreole.render_xhtml(data)
document = Parser(data).parse()
output = HtmlEmitter(document).emit()
out_file.write(output)

def create_post(self, path, **kw):
Expand Down

0 comments on commit 5e8a205

Please sign in to comment.