Skip to content
Permalink
Browse files
Mentioning MarkDown plugin (getnikola/nikola#2622). Removed compile_s…
…tring function support.
  • Loading branch information
felixfontein committed Jan 8, 2017
1 parent c58e2a2 commit 339ae5ec6e18e4528af61594e57802c1eb634af8
Showing with 3 additions and 8 deletions.
  1. +1 −1 v7/static_comments/README.md
  2. +2 −7 v7/static_comments/static_comments.py
@@ -31,7 +31,7 @@ Comment files are of the following form::

the content spans the rest of the file.

Most header fields are optional. `compiler` must specify a page compiler which allows to compile a content given as a string to a string; these are currently the restructured text compiler (`rest`), the `ipynb` compiler, and the [WordPress](https://plugins.getnikola.com/#wordpress_compiler) (`wordpress`) compiler. You can also specify `html`, in which case the comment's content will be taken as HTML without any processing.
Most header fields are optional. `compiler` must specify a page compiler which allows to compile a content given as a string to a string; these are currently the restructured text compiler (`rest`), the MarkDown compiler (`markdown`; only allows this in Nikola git master yet, though), and the [WordPress](https://plugins.getnikola.com/#wordpress_compiler) (`wordpress`) compiler. You can also specify `html`, in which case the comment's content will be taken as HTML without any processing.

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jan 8, 2017

Member

you can say v7.8.2 here


Comments can form a hierarchy; `parent_id` must be the comment ID of the parent comment, or left away if there's no parent.

@@ -89,17 +89,12 @@ def _compile_content(self, compiler_name, content, filename):
_LOGGER.error("Restructured text page compiler ({0}) failed to compile comment {1}!".format(compiler_name, filename))
exit(1)
return content
elif compiler_name == 'ipynb':
return compiler.compile_string(content)
else:
try:
return compiler.compile_to_string(content) # This is a non-standard function! May not be available with any page compiler!
except AttributeError:
try:
return compiler.compile_string(content) # This is a non-standard function! May not be available with any page compiler!
except AttributeError:
_LOGGER.error("Page compiler plugin '{0}' provides no compile_to_string or compile_string function (comment {1})!".format(compiler_name, filename))
exit(1)
_LOGGER.error("Page compiler plugin '{0}' provides no compile_to_string function (comment {1})!".format(compiler_name, filename))
exit(1)

def _read_comment(self, filename, owner, id):
"""Read a comment from a file."""

2 comments on commit 339ae5e

@Kwpolska

This comment has been minimized.

Copy link
Member

@Kwpolska Kwpolska replied Jan 8, 2017

👎, the API should be compile_string to match the official, built-in reST plugin.

@felixfontein

This comment has been minimized.

Copy link
Contributor Author

@felixfontein felixfontein replied Jan 8, 2017

It matches it as closely as it can. The second return argument makes no sense for MarkDown.

Please sign in to comment.