Skip to content

Commit

Permalink
shortcodes for markmin
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Sep 24, 2016
1 parent 2c9e7df commit 3067694
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions v7/markmin/README.md
Expand Up @@ -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.



2 changes: 1 addition & 1 deletion v7/markmin/markmin.plugin
Expand Up @@ -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
12 changes: 10 additions & 2 deletions v7/markmin/markmin/__init__.py
Expand Up @@ -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.')
Expand Down

0 comments on commit 3067694

Please sign in to comment.