Skip to content
Permalink
Browse files

Allowing to pass through HTML.

  • Loading branch information
felixfontein committed Jan 8, 2017
1 parent 95ebbb5 commit c58e2a288caccd4433755c7a59c5bda27adada60
Showing with 6 additions and 1 deletion.
  1. +3 −1 v7/static_comments/README.md
  2. +3 −0 v7/static_comments/static_comments.py
@@ -31,7 +31,9 @@ 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. Comments can form a hierarchy; `parent_id` must be the comment ID of the parent comment, or left away if there's no parent.
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.

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


Inclusion in theme
@@ -76,6 +76,9 @@ class StaticComments(SignalHandler):

def _compile_content(self, compiler_name, content, filename):
"""Compile comment content with specified page compiler."""
if compiler_name == 'html':
# Special case: just pass-through content.
return content
if compiler_name not in self.site.compilers:
_LOGGER.error("Cannot find page compiler '{0}' for comment {1}!".format(compiler_name, filename))
exit(1)

0 comments on commit c58e2a2

Please sign in to comment.
You can’t perform that action at this time.