Пример #1
0
  def load(self) -> PydocMarkdown:
    """
    Loads the configuration and applies the overrides.
    """

    config = PydocMarkdown()
    if self.config:
      config.load_config(self.config)
    self._apply_overrides(config)

    if isinstance(self.config, str):
      config.init(Context(directory=os.path.dirname(os.path.abspath(self.config))))

    if config.unknown_fields:
      logger.warning('Unknown configuration options: %s', ', '.join(config.unknown_fields))

    return config
Пример #2
0
import yaml
import os
import yaml

from pydoc_markdown import PydocMarkdown

if __name__ == "__main__":
    config = yaml.safe_load(open(".pydocs"))

    pydoc = PydocMarkdown()

    pydoc.load_config(config)
    pydoc.load_modules()
    pydoc.process()
    pydoc.render()

    os.remove("build/docs/mkdocs.yml")