diff --git a/doc/sphinxext/gen_gallery.py b/doc/sphinxext/gen_gallery.py index d03e4e005c66..74544ae66595 100644 --- a/doc/sphinxext/gen_gallery.py +++ b/doc/sphinxext/gen_gallery.py @@ -1,4 +1,4 @@ -# -*- coding: UTF-8 -*- +# -*- coding: utf-8 -*- import codecs import os import re @@ -14,7 +14,7 @@ multiimage = re.compile('(.*?)(_\d\d){1,2}') # generate a thumbnail gallery of examples -gallery_template = """\ +gallery_template = u"""\ {{% extends "layout.html" %}} {{% set title = "Thumbnail gallery" %}} @@ -35,7 +35,7 @@ {{% endblock %}} """ -header_template = """\ +header_template = u"""\

{title}ΒΆ @@ -48,7 +48,7 @@ """ -toc_template = """\ +toc_template = u"""\
  • {title}
  • """ @@ -133,10 +133,10 @@ def gen_gallery(app, doctree): warnings.warn("No thumbnails were found in %s" % subdir) # Close out the
    opened up at the top of this loop - rows.append("
    ") + rows.append(u"

    ") - content = gallery_template.format(toc='\n'.join(toc_rows), - gallery='\n'.join(rows)) + content = gallery_template.format(toc=u'\n'.join(toc_rows), + gallery=u'\n'.join(rows)) # Only write out the file if the contents have actually changed. # Otherwise, this triggers a full rebuild of the docs