From ab521ce9850b0c410c05c35880424db47c84720d Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Fri, 6 Nov 2020 02:52:57 +0000 Subject: [PATCH] add heading to OrgRootNode (always empty) --- orgparse/node.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/orgparse/node.py b/orgparse/node.py index c21386f..b94735b 100644 --- a/orgparse/node.py +++ b/orgparse/node.py @@ -737,6 +737,10 @@ def body_rich(self) -> Iterator[Rich]: r = self.get_body(format='rich') return cast(Iterator[Rich], r) # meh.. + @property + def heading(self) -> str: + raise NotImplementedError + def is_root(self): """ Return ``True`` when it is a root node. @@ -797,6 +801,10 @@ def _body_lines(self) -> List[str]: # type: ignore[override] # for root node, the body is whatever is before the first node return self._lines + @property + def heading(self) -> str: + return '' + @property def level(self): return 0