summaryrefslogtreecommitdiffstats
path: root/nikola/md.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2012-12-12 20:15:48 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2012-12-12 20:15:48 -0300
commit0f2c04e70a0ffdd0892d6970cafbcd952d221db5 (patch)
treed36f7747c4b9cb5c5e00cae5b137d22214b1c7be /nikola/md.py
parentca1f5a392261a7c6b82b5ac1015427605909d8c9 (diff)
Imported Upstream version 5upstream/5
Diffstat (limited to 'nikola/md.py')
-rw-r--r--nikola/md.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/nikola/md.py b/nikola/md.py
deleted file mode 100644
index 16bcec8..0000000
--- a/nikola/md.py
+++ /dev/null
@@ -1,29 +0,0 @@
-"""Implementation of compile_html based on markdown."""
-
-__all__ = ['compile_html']
-
-import codecs
-import os
-import re
-
-from markdown import markdown
-
-
-def compile_html(source, dest):
- try:
- os.makedirs(os.path.dirname(dest))
- except:
- pass
- with codecs.open(dest, "w+", "utf8") as out_file:
- with codecs.open(source, "r", "utf8") as in_file:
- data = in_file.read()
-
- output = markdown(data, ['fenced_code', 'codehilite'])
- # remove the H1 because there is "title" h1.
- output = re.sub(r'<h1>.*</h1>', '', output)
- # python-markdown's highlighter uses the class 'codehilite' to wrap
- # code, # instead of the standard 'code'. None of the standard pygments
- # stylesheets use this class, so swap it to be 'code'
- output = re.sub(r'(<div[^>]+class="[^"]*)codehilite([^>]+)',
- r'\1code\2', output)
- out_file.write(output)