Feat: Complete tags property #10

Merged
kenkeiras merged 6 commits from feat/consider-file-tags-on-headlines into develop 2024-09-03 18:33:04 +00:00
Showing only changes of commit 570e6bb764 - Show all commits

View File

@ -753,9 +753,6 @@ class Headline:
@property
def tags(self):
if isinstance(self.parent, OrgDoc):
return list(self.shallow_tags)
else:
return list(self.shallow_tags) + self.parent.tags
def add_tag(self, tag: str):
@ -2280,6 +2277,13 @@ class OrgDoc:
def path(self):
return self._path
@property
def tags(self) -> list[str]:
for kw in self.keywords:
if kw.key == "FILETAGS":
return kw.value.strip(':').split(':')
return []
## Querying
def get_links(self):
for headline in self.headlines: