Start working on rendering part

This commit is contained in:
Joscha 2019-05-10 10:28:14 +00:00
parent 573e538869
commit ef5320058c
5 changed files with 552 additions and 0 deletions

29
cheuph/render/element.py Normal file
View file

@ -0,0 +1,29 @@
from typing import Hashable, List
from .markup import AttributedText
__all__ = ["Id", "Element", "ElementSupply", "RenderedElement"]
Id = Hashable
class Element:
pass
class ElementSupply:
pass
class RenderedElement:
def __init__(self,
element: Element,
rendered: List[AttributedText],
) -> None:
self._element = element
self._lines = rendered
@property
def element(self) -> Element:
return self._element
@property
def height(self) -> int:
return len(self._lines)