mirror of
https://github.com/dtomlinson91/tembo.git
synced 2025-12-22 11:05:44 +00:00
adding initial Page scaffolding
This commit is contained in:
Binary file not shown.
Binary file not shown.
1
tembo/journal/__init__.py
Normal file
1
tembo/journal/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from tembo.journal import pages
|
||||
51
tembo/journal/pages.py
Normal file
51
tembo/journal/pages.py
Normal 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
|
||||
Reference in New Issue
Block a user