"""The Mkdocs Plugin."""

from __future__ import annotations

from mkdocs.config import base, config_options as c


class PluginConfig(base.Config):
    build_fn = c.Optional(c.Type(str))
    """Path to the build script / callable.

    Possible formats:

      - `my.module:Class.build_fn` (must be a classmethod / staticmethod)
      - `my.module:build_fn`
      - `path/to/file.py:build_fn`

    Can also be remote.
    The targeted callable gets the project instance as an argument and optionally
    keyword arguments from setting below.
    """
    kwargs = c.Optional(c.Type(dict))
    """Keyword arguments passed to the build script / callable.

    Build scripts may have keyword arguments. You can set them by using this setting.
    """
    repo_path = c.Type(str, default=".")
    """Path to the repository to create a website for. (`http://....my_project.git`)"""
    clone_depth = c.Type(int, default=100)
    """Clone depth in case the repository is remote. (Required for `git-changelog`)."""
    build_folder = c.Optional(c.Type(str))
    """Folder to create the Markdown files in.

    If no folder is set, **MkNodes** will generate a temporary dir."""
    show_code_admonition = c.Type(bool, default=False)
    """Append an admonition box with the generator code to each page.

    If True, all pages get added an expandable admonition box at the bottom,
    containing the code which generated the page.
    In order for this to work, the page needs to be created via decorators, or
    the `generated_by` attribute of the MkPage needs to be set manually.
    """
