Skip to content

Commit

Permalink
feat: Add recursive option from toml config to MarkdownEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
bow committed Oct 14, 2023
1 parent 8e7349d commit 9ad8839
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions volt/engines/markdown2.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
self.template = Template(default_fp.read_text())

self.extras = self.opts.pop("extras", None)
self.recursive = self.opts.pop("recursive", False)

def prepare_outputs(self, with_draft: bool) -> Sequence[TemplateOutput]:
src_dirs = [self.config.contents_dir]
Expand All @@ -95,15 +96,14 @@ def prepare_outputs(self, with_draft: bool) -> Sequence[TemplateOutput]:
def read_sources(
self,
base_dir: Path,
recursive: bool = False,
) -> Sequence["MarkdownSource"]:
return [
MarkdownSource.from_path(
path=fp,
config=self.config,
converter=self.converter,
)
for fp in self.get_source_paths(base_dir)
for fp in self.get_source_paths(base_dir, recursive=self.recursive)
]

@cached_property
Expand Down

0 comments on commit 9ad8839

Please sign in to comment.