adding initial Page scaffolding

This commit is contained in:
2021-10-21 00:22:20 +01:00
parent 51473e11d2
commit 5474c3c273
8 changed files with 76 additions and 3 deletions

Binary file not shown.

View File

@@ -0,0 +1 @@
from tembo.journal import pages

51
tembo/journal/pages.py Normal file
View File

@@ -0,0 +1,51 @@
from __future__ import annotations
from abc import ABCMeta, abstractmethod
class PageCreator:
@abstractmethod
def create_page(self, path, user_input, raw_entry_input) -> Page:
pass
class ScopedPageCreator(PageCreator):
def create_page(
self, path: str, user_input, raw_entry_input: dict | None = None
) -> Page:
pass
class Page(metaclass=ABCMeta):
@abstractmethod
def __init__(self) -> None:
pass
@abstractmethod
def save_to_disk(self) -> None:
pass
class ScopedPage(Page):
"""A Page that uses substitute tokens."""
def __init__(self, path: str, raw_entry_input: dict):
self.path = path
self._raw_entry_input = raw_entry_input
self._squashed_content: dict = {}
self._page_content: str = ""
def save_to_disk(self) -> None:
# create the file/folder if it doesnt exist
pass
def _convert_to_path(self):
# take a path str and convert to pathlib
# substitute the tokens in
pass
def squash_raw_entry_input(self) -> None:
pass
def substitute_tokens(self) -> None:
pass