Skip to content
Permalink
Browse files
shortcodes for markmin
  • Loading branch information
ralsina committed Sep 24, 2016
1 parent 2c9e7df commit 3067694547386418ee881607762260cc9852ba69
Showing with 13 additions and 3 deletions.
  1. +2 −0 v7/markmin/README.md
  2. +1 −1 v7/markmin/markmin.plugin
  3. +10 −2 v7/markmin/markmin/__init__.py
@@ -2,5 +2,7 @@ Compiler plugin to support the Markmin markup.

[More information about MarkMin](http://www.web2py.com/init/static/markmin.html)

**NOTE:** This plugin is for python version 2 only.



@@ -7,6 +7,6 @@ plugincategory = Compiler

[Documentation]
Author = Roberto Alsina
Version = 0.3
Version = 0.4
Website = http://plugins.getnikola.com/#markmin
Description = Compile Markmin into HTML
@@ -54,8 +54,16 @@ def compile_html(self, source, dest, is_two_file=True):
if not is_two_file:
spl = re.split('(\n\n|\r\n\r\n)', data, maxsplit=1)
data = spl[-1]
body = m2h.markmin2html(data, pretty_print=True)
out_f.write(body)
output = m2h.markmin2html(data, pretty_print=True)
output, shortcode_deps = self.site.apply_shortcodes(output, filename=source, with_dependencies=True, extra_context=dict(post=post))
out_f.write(output)
if post is None:
if shortcode_deps:
self.logger.error(
"Cannot save dependencies for post {0} due to unregistered source file name",
source)
else:
post._depfile[dest] += shortcode_deps

def create_post(self, path, **kw):
content = kw.pop('content', 'Write your post here.')

0 comments on commit 3067694

Please sign in to comment.