split out path from permalink
This commit is contained in:
parent
7b9266b25d
commit
d0fd6f822a
1 changed files with 7 additions and 2 deletions
|
@ -68,13 +68,18 @@ class Node(NamedTuple):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def children(self) -> List['Node']:
|
def children(self) -> List['Node']:
|
||||||
|
# TODO def. cache..
|
||||||
ch = self.raw.get(Keys.CHILDREN, [])
|
ch = self.raw.get(Keys.CHILDREN, [])
|
||||||
return list(map(Node, ch))
|
return list(map(Node, ch))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def path(self) -> str:
|
||||||
|
username = config.username # sadly, Roam research export doesn't provide it
|
||||||
|
return f'{username}/page/{self.uid}'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def permalink(self) -> str:
|
def permalink(self) -> str:
|
||||||
username = config.username # sadly, Roam research doesn't provide 3
|
return f'https://roamresearch.com/#/app/{self.path}'
|
||||||
return f'https://roamresearch.com/#/app/{username}/page/{self.uid}'
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def uid(self) -> str:
|
def uid(self) -> str:
|
||||||
|
|
Loading…
Add table
Reference in a new issue