forked from kenkeiras/org-rw
Support non-recursive dump_headline
.
This commit is contained in:
parent
eb3c789fad
commit
434fb8ab0e
@ -1673,7 +1673,7 @@ class OrgDoc:
|
|||||||
yield from headline.get_code_snippets()
|
yield from headline.get_code_snippets()
|
||||||
|
|
||||||
# Writing
|
# Writing
|
||||||
def dump_headline(self, headline):
|
def dump_headline(self, headline, recursive=True):
|
||||||
|
|
||||||
tags = ""
|
tags = ""
|
||||||
if len(headline.shallow_tags) > 0:
|
if len(headline.shallow_tags) > 0:
|
||||||
@ -1746,8 +1746,9 @@ class OrgDoc:
|
|||||||
content = content[:-1]
|
content = content[:-1]
|
||||||
yield content
|
yield content
|
||||||
|
|
||||||
|
if recursive:
|
||||||
for child in headline.children:
|
for child in headline.children:
|
||||||
yield from self.dump_headline(child)
|
yield from self.dump_headline(child, recursive=recursive)
|
||||||
|
|
||||||
def dump(self):
|
def dump(self):
|
||||||
lines = []
|
lines = []
|
||||||
|
Loading…
Reference in New Issue
Block a user