3 \|@s$dZddlmZGdddeZdS)zZ Extensions ----------------------------------------------------------------------------- )unicode_literalsc@sFeZdZdZifddZdddZddZd d Zd d Zd dZ dS) Extensionz( Base class for extensions to subclass. cCs ||_dS)zCreate an instance of an Extention. Keyword arguments: * configs: A dict of configuration setting used by an Extension. N)config)selfconfigsr)build/lib/markdown/extensions/__init__.py__init__ szExtension.__init__cCs ||jkr|j|dS|SdS)z8 Return a setting for the given key or an empty string. rN)r)rkeydefaultrrr getConfigs zExtension.getConfigcstfddjjDS)z( Return all configs settings as a dict. csg|]}|j|fqSr)r ).0r )rrr sz(Extension.getConfigs..)dictrkeys)rr)rr getConfigsszExtension.getConfigscsfddjjDS)z5 Return all config descriptions as a list of tuples. csg|]}|j|dfqS))r)rr )rrrr sz+Extension.getConfigInfo..)rr)rr)rr getConfigInfoszExtension.getConfigInfocCs||j|d<dS)z8 Set a config setting for `key` with the given `value`. rN)r)rr valuerrr setConfig"szExtension.setConfigcCstd|jj|jjfdS)a Add the various proccesors and patterns to the Markdown Instance. This method must be overriden by every extension. Keyword arguments: * md: The Markdown instance. * md_globals: Global variables in the markdown module namespace. z8Extension "%s.%s" must define an "extendMarkdown"method.N)NotImplementedError __class__ __module____name__)rmdZ md_globalsrrrextendMarkdown&s zExtension.extendMarkdownN)r ) rr __qualname____doc__r r rrrrrrrrrs rN)r __future__robjectrrrrrs