6df57370d35c

Add plugins to markdown
[view raw] [browse files]
author theaspect@gmail.com
date Sat, 01 Jun 2013 16:28:38 +0700
parents 207f7e9a3d73
children 5e0c6589d134
branches/tags (none)
files __init__.py

Changes

--- a/__init__.py	Tue May 21 01:37:47 2013 +0800
+++ b/__init__.py	Sat Jun 01 16:28:38 2013 +0700
@@ -64,11 +64,11 @@
 def file_markdown(orig, web, req, tmpl):
 	f = req.form.get('file', [''])[0]
 	parts = os.path.splitext(f)
-	
-	
+
+
 	if 'file' not in req.form:
 		return webcommands.manifest(web, req, tmpl)
-	
+
 	if not parts[-1] == '.markdown' and not parts[-1] == '.md':
 		return orig(web, req, tmpl)
 
@@ -99,7 +99,7 @@
 
 	ext = mdx_urlrebase.UrlRebaseExtension(configs=[('rebase', rebase)])
 	md = markdown.Markdown(
-			extensions=[ext, 'wikilinks'],
+			extensions=[ext, 'wikilinks','toc','headerid','attr_list'],
 			extension_configs={
 				'wikilinks' : [('base_url', ""), ('end_url', parts[-1])]})
 	html = md.convert(text).encode("utf-8")
@@ -155,7 +155,7 @@
 
 		ext = mdx_urlrebase.UrlRebaseExtension(configs=[('rebase', rebase)])
 		md = markdown.Markdown(
-			extensions=[ext, 'wikilinks'],
+			extensions=[ext, 'wikilinks','toc','headerid','attr_list'],
 			extension_configs={
 				'wikilinks' : [('base_url', base_url), ('end_url', filesuffix)]})
 		readme = md.convert(text).encode("utf-8")