Skip to content

Commit

Permalink
add heading to OrgRootNode (always empty)
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Nov 6, 2020
1 parent 731606e commit ab521ce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions orgparse/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ab521ce

Please sign in to comment.