Add helper to get document from a Headline.

This commit is contained in:
Sergio Martínez Portela 2022-03-28 00:49:32 +02:00
parent 52d8cf59ce
commit 3da2ab066c

View File

@ -272,6 +272,14 @@ class Headline:
# Remove from contents # Remove from contents
self._remove_element_in_line(start_line + 1) self._remove_element_in_line(start_line + 1)
@property
def doc(self):
par = self.parent
while isinstance(par, Headline):
par = par.parent
return par
def as_dom(self): def as_dom(self):
everything = ( everything = (
self.keywords self.keywords