Skip to content

mkdocs

Class CustomizedMarkdownRenderer

@dataclasses.dataclass
class CustomizedMarkdownRenderer(MarkdownRenderer)

[view_source]

We override some defaults in this subclass.

Class MkdocsRenderer

@dataclasses.dataclass
class MkdocsRenderer(Renderer, Server, Builder)

[view_source]

Produces Markdown files in a layout compatible with [MkDocs][0] and can be used with the Pydoc-Markdown --server option for a live-preview. The --bootstrap mkdocs option can be used to create a Pydoc-Markdown configuration file with the MkDocs template.

Example configuration:

renderer:
  type: mkdocs
  pages:
    - title: Home
      name: index
      source: README.md
    - title: API Documentation
      contents:
        - '*'
  mkdocs_config:
    site_name: My Project
    theme: readthedocs

Options

output_directory

The output directory for the generated Markdown files. Defaults to build/docs.

content_directory_name

Name of the content directory (inside the output_directory). Defaults to "content".

clean_render

Remove files generated in a previous pass by the Mkdocs renderer before rendering again. Defaults to True.

markdown

Markdown renderer settings.

site_name

The name of the site. This will be carried into the site_name key of the mkdocs_config.

mkdocs_config

Arbitrary configuration values that will be rendered to an mkdocs.yml file.

server_port

Port for the Mkdocs server when using the pydoc-markdown --server option. Defaults to 8000. Can be set with the MKDOCS_PORT environment variable:

$ MKDOCS_PORT=8383 pydoc-markdown -so