Example #1
0
    def process(self, modules: List[docspec.Module],
                resolver: Optional[Resolver]):
        unresolved: Dict[str, List[str]] = {}
        if resolver:
            reverse = docspec.ReverseMap(modules)
            docspec.visit(
                modules, lambda x: self._preprocess_refs(
                    x, resolver, reverse, unresolved))

        if unresolved:
            summary = []
            for uid, refs in unresolved.items():
                summary.append('  {}: {}'.format(uid, ', '.join(refs)))

            logger.warning(
                '%s cross-reference(s) could not be resolved:\n%s',
                sum(map(len, unresolved.values())),
                '\n'.join(summary),
            )
Example #2
0
    def process(self, modules: List[docspec.Module],
                resolver: Optional[Resolver]):
        unresolved = {}
        if resolver:
            reverse = docspec.ReverseMap(modules)
            docspec.visit(
                modules,
                lambda x: self._preprocess_refs(x, resolver, reverse,
                                                unresolved),
            )

        if unresolved:
            summary = [
                "  {}: {}".format(uid, ", ".join(refs))
                for uid, refs in unresolved.items()
            ]

            logger.warning(
                "%s cross-reference(s) could not be resolved:\n%s",
                sum(map(len, unresolved.values())),
                "\n".join(summary),
            )
Example #3
0
 def process(self, modules: List[docspec.Module],
             resolver: Optional[Resolver]) -> None:
     docspec.visit(modules, self._process)