mirror of
https://github.com/dtomlinson91/tembo.git
synced 2026-02-06 13:05:45 +00:00
adding latest
This commit is contained in:
@@ -43,6 +43,7 @@ class PageCreatorOptions:
|
||||
|
||||
|
||||
class PageCreator:
|
||||
@abstractmethod
|
||||
def __init__(self, options: PageCreatorOptions) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -52,7 +53,7 @@ class PageCreator:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def create_page(self, options: PageCreatorOptions) -> Page:
|
||||
def create_page(self) -> Page:
|
||||
raise NotImplementedError
|
||||
|
||||
def _check_base_path_exists(self) -> None:
|
||||
@@ -111,16 +112,15 @@ class ScopedPageCreator(PageCreator):
|
||||
extension (str): extension of file.
|
||||
"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
def __init__(self, options: PageCreatorOptions) -> None:
|
||||
self._all_input_tokens: list[str] = []
|
||||
self._options: PageCreatorOptions
|
||||
self._options = options
|
||||
|
||||
@property
|
||||
def options(self) -> PageCreatorOptions:
|
||||
return self._options
|
||||
|
||||
def create_page(self, options: PageCreatorOptions) -> Page:
|
||||
self._options = options
|
||||
def create_page(self) -> Page:
|
||||
self._check_base_path_exists()
|
||||
|
||||
self._all_input_tokens = self._get_input_tokens()
|
||||
@@ -130,7 +130,7 @@ class ScopedPageCreator(PageCreator):
|
||||
path = pathlib.Path(self._substitute_tokens(str(path)))
|
||||
|
||||
template_contents = self._load_template()
|
||||
if options.template_filename is not None:
|
||||
if self.options.template_filename is not None:
|
||||
template_contents = self._substitute_tokens(template_contents)
|
||||
|
||||
return ScopedPage(path, template_contents)
|
||||
|
||||
Reference in New Issue
Block a user