forked from kenkeiras/org-rw
Implement OrgDoc .tags
.
This commit is contained in:
parent
e0306bf3a5
commit
570e6bb764
@ -753,10 +753,7 @@ class Headline:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def tags(self):
|
def tags(self):
|
||||||
if isinstance(self.parent, OrgDoc):
|
return list(self.shallow_tags) + self.parent.tags
|
||||||
return list(self.shallow_tags)
|
|
||||||
else:
|
|
||||||
return list(self.shallow_tags) + self.parent.tags
|
|
||||||
|
|
||||||
def add_tag(self, tag: str):
|
def add_tag(self, tag: str):
|
||||||
self.shallow_tags.append(tag)
|
self.shallow_tags.append(tag)
|
||||||
@ -2280,6 +2277,13 @@ class OrgDoc:
|
|||||||
def path(self):
|
def path(self):
|
||||||
return self._path
|
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
|
## Querying
|
||||||
def get_links(self):
|
def get_links(self):
|
||||||
for headline in self.headlines:
|
for headline in self.headlines:
|
||||||
|
Loading…
Reference in New Issue
Block a user