Skip to content

mkdocs_nype.plugins.custom_cta_sections.plugin

Synopsis

MkDocs plugin, which adds CTA sections with a given prompt

Can be seen in use here:

MIT License 2024 Kamil Krzyśków (HRY) for Nype (npe.cm)

PLUGIN_NAME

PLUGIN_NAME: str = 'custom_cta_sections'

Name of this plugin. Used in logging.

LOG

LOG: PrefixedLogger = PrefixedLogger(PLUGIN_NAME, getLogger(f'mkdocs.plugins.{PLUGIN_NAME}'))

Logger instance for this plugins.

TITLE_AND_CTA_TEMPLATE

TITLE_AND_CTA_TEMPLATE: str = strip()

CustomCallToActionSectionsPlugin

CustomCallToActionSectionsPlugin()

Bases: BasePlugin[CustomCallToActionSectionsConfig]

sanitized_paths

sanitized_paths: Path = []

sanitized_target

sanitized_target: Path = None

on_config

on_config(config: MkDocsConfig) -> MkDocsConfig | None

Sanitize prefixes for later usage

on_page_markdown

on_page_markdown(markdown: str, /, *, page: Page, config: MkDocsConfig, files: Files) -> str | None

Add the section to a page