def lydocinfo(self): """Return the lydocinfo instance for our document.""" if self._lydocinfo is None: doc = lydocument.Document(self.document()) v = variables.manager(self.document()).variables() self._lydocinfo = lydocinfo.DocInfo(doc, v) return self._lydocinfo
def docinfo(filename): """Return a (cached) LyDocInfo instance for the specified file.""" c = _cached(filename) if c.docinfo is None: c.docinfo = lydocinfo.DocInfo(c.document, c.variables) return c.docinfo