diff --git a/mknodes/basenodes/mkcodeimage.py b/mknodes/basenodes/mkcodeimage.py index 37bdeede..f80001c8 100644 --- a/mknodes/basenodes/mkcodeimage.py +++ b/mknodes/basenodes/mkcodeimage.py @@ -50,7 +50,7 @@ def __repr__(self): ) @property - def code(self): + def code(self) -> str: match self._code: case str(): return self._code diff --git a/mknodes/pages/mkpage.py b/mknodes/pages/mkpage.py index 03edac8d..d99ec2b7 100644 --- a/mknodes/pages/mkpage.py +++ b/mknodes/pages/mkpage.py @@ -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):