43
43
from n2y .utils import available_from_list , pandoc_ast_to_markdown
44
44
45
45
46
- # Custom Jinja Tests
47
46
def regex_search (value , pattern ):
48
47
return bool (re .search (pattern , value ))
49
48
50
49
51
- # Custom Jinja Filters
52
50
def _canonicalize (markdown ):
53
51
markdown = markdown .replace ("\u201d " , '"' ).replace ("\u201c " , '"' )
54
52
markdown = markdown .replace ("\u2019 " , "'" ).replace ("\u2018 " , "'" )
@@ -126,7 +124,6 @@ def join_to(foreign_keys, table, primary_key="notion_id"):
126
124
return joined
127
125
128
126
129
- # Jinja Environment Management
130
127
def _create_jinja_environment ():
131
128
environment = jinja2 .Environment (
132
129
cache_size = 0 ,
@@ -140,7 +137,6 @@ def _create_jinja_environment():
140
137
return environment
141
138
142
139
143
- # Jinja Rendering
144
140
def render_from_string (source , context = None , environment = None ):
145
141
if environment is None :
146
142
environment : jinja2 .Environment = _create_jinja_environment ()
@@ -155,7 +151,6 @@ def render_from_string(source, context=None, environment=None):
155
151
return output
156
152
157
153
158
- # Util Classes
159
154
class JinjaExceptionInfo :
160
155
err : Exception
161
156
obj : object
@@ -255,7 +250,6 @@ def source(self):
255
250
return self ._source
256
251
257
252
258
- # Plugin Classes
259
253
class JinjaRenderPage (Page ):
260
254
def __init__ (self , client , notion_data ):
261
255
super ().__init__ (client , notion_data )
0 commit comments