@@ -35,7 +35,7 @@ def parse_template_paths(
35
35
filepath_collections = [
36
36
os .path .join (dirpath , filename )
37
37
for dirpath , _ , filenames in os .walk (path )
38
- for filename in filenames
38
+ for filename in sorted ( filenames )
39
39
if (not filename_filter or re .match (filename_filter , filename ))
40
40
]
41
41
return list (itertools .chain (filepath_collections ))
@@ -66,16 +66,17 @@ def make_rst(self):
66
66
template_paths = parse_template_paths (
67
67
root_path , env .config ["jinja_template_pattern" ]
68
68
)
69
- raw_docstrings = [parse_jinja_comment (path ) for path in template_paths ]
70
- docstrings = [
71
- prepare_docstring (raw_docstring )
72
- for raw_docstring in raw_docstrings
73
- if raw_docstring is not None
74
- ]
75
69
if env .config ["jinja_template_path" ]:
76
- for docstring in docstrings :
77
- if docstring is not None :
78
- yield from autotemplate_directive (path , docstring )
70
+ for template_path in template_paths :
71
+ raw_docstring = parse_jinja_comment (template_path )
72
+ if raw_docstring is None :
73
+ continue
74
+
75
+ docstring = prepare_docstring (raw_docstring )
76
+ if docstring is None :
77
+ continue
78
+
79
+ yield from autotemplate_directive (template_path , docstring )
79
80
yield ""
80
81
81
82
def run (self ) -> list [nodes .Node ]:
0 commit comments