Skip to content
Permalink
Browse files
Merge branch 'master' into fix-2205
  • Loading branch information
ralsina committed Jan 4, 2016
2 parents c84e558 + 7803f7a commit aaa8cb7f7a6d54552d469529b9e7b22240a6b579
Showing with 309 additions and 142 deletions.
  1. +2 −2 nikola/nikola.py
  2. +1 −1 nikola/plugins/compile/markdown/__init__.py
  3. +282 −138 nikola/shortcodes.py
  4. +24 −1 tests/test_shortcodes.py
@@ -1318,9 +1318,9 @@ def register_shortcode(self, name, f):
return
self.shortcode_registry[name] = f

def apply_shortcodes(self, data):
def apply_shortcodes(self, data, filename=None):
"""Apply shortcodes from the registry on data."""
return shortcodes.apply_shortcodes(data, self.shortcode_registry)
return shortcodes.apply_shortcodes(data, self.shortcode_registry, self, filename)

def generic_rss_renderer(self, lang, title, link, description, timeline, output_path,
rss_teasers, rss_plain, feed_length=10, feed_url=None,
@@ -76,7 +76,7 @@ def compile_html(self, source, dest, is_two_file=True):
if not is_two_file:
_, data = self.split_metadata(data)
output = markdown(data, self.extensions)
output = apply_shortcodes(output, self.site.shortcode_registry, self.site)
output = apply_shortcodes(output, self.site.shortcode_registry, self.site, source)
out_file.write(output)

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

0 comments on commit aaa8cb7

Please sign in to comment.