@@ -54,7 +54,7 @@ def get_source(
54
54
filename = os .path .join (self .path , removesuffix (template , ".html.jinja2" ) + ".md" )
55
55
56
56
if os .path .exists (filename ):
57
- with open (filename , encoding = ' utf-8' ) as fd :
57
+ with open (filename , encoding = " utf-8" ) as fd :
58
58
metadata , markdown = frontmatter .parse (fd .read ())
59
59
assert isinstance (metadata , dict )
60
60
source = """
@@ -74,8 +74,9 @@ def get_source(
74
74
else :
75
75
raise TemplateNotFound (filename )
76
76
77
+
77
78
class MarkdownNewsLoader (BaseLoader ):
78
- """Finds news articles written in Markdown and wrangles them into a Jinja template
79
+ """Finds news articles written in Markdown and wrangles them into a Jinja template
79
80
extending article.html.jinja2"""
80
81
81
82
def __init__ (self , searchpath : str , prefix_allow : Optional [str ] = None ) -> None :
@@ -118,7 +119,7 @@ def get_source(
118
119
119
120
filename = os .path .join (self .searchpath , removesuffix (template , ".html.jinja2" ) + ".md" )
120
121
if os .path .exists (filename ):
121
- with open (filename , encoding = ' utf-8' ) as fd :
122
+ with open (filename , encoding = " utf-8" ) as fd :
122
123
metadata , content = frontmatter .parse (fd .read ())
123
124
# NB: readlines() returns a list of lines WITH \n at the end
124
125
@@ -141,4 +142,4 @@ def get_source(
141
142
return (source , filename , None )
142
143
# TODO: add 3rd tuple argument for autoreloading
143
144
else :
144
- raise TemplateNotFound (template )
145
+ raise TemplateNotFound (template )
0 commit comments