Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Sep 19, 2023
1 parent 3bf5d3a commit 449b309
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mknodes/basenodes/mkcodeimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __repr__(self):
)

@property
def code(self):
def code(self) -> str:
match self._code:
case str():
return self._code
Expand Down
2 changes: 2 additions & 0 deletions mknodes/pages/mkpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ def __repr__(self):
return reprhelpers.get_repr(self, path=str(self.path), **self._metadata)

def is_index(self) -> bool:
"""Returns True if the page is the index page for the parent Nav."""
return self.parent.index_page is self if self.parent else False

@property
def metadata(self) -> metadata.Metadata:
"""Return page metadata, complemented with the parent Nav metadata objects."""
meta = metadata.Metadata()
navs = [i for i in self.ancestors if isinstance(i, mknav.MkNav)]
for nav in reversed(navs):
Expand Down

0 comments on commit 449b309

Please sign in to comment.