mkdocs-apidescribed-plugin 1.1.0__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocs-apidescribed-plugin
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: mkdocs plugin to generate API documentation for Python programs
5
5
  Project-URL: Homepage, https://github.com/idlesign/mkdocs-apidescribed-plugin
6
6
  Project-URL: Documentation, https://mkdocs-apidescribed-plugin.readthedocs.org/
@@ -0,0 +1,2 @@
1
+
2
+ VERSION = '1.2.0'
@@ -0,0 +1,38 @@
1
+ import mkdocs
2
+ from material.extensions.emoji import twemoji, to_svg
3
+ from mkdocs.config.defaults import MkDocsConfig
4
+ from mkdocs.plugins import get_plugin_logger
5
+
6
+ log = get_plugin_logger(__name__)
7
+
8
+
9
+ class ApiDescribedPlugin(mkdocs.plugins.BasePlugin):
10
+
11
+ _required_extensions = [
12
+ 'mkdocs_apidescribed.extension', # this is our extension
13
+ 'admonition', # nice admonitions
14
+ 'md_in_html', # for proper indentation
15
+ 'pymdownx.details', # collapsible blocks
16
+ 'pymdownx.superfences', # for block embedding
17
+ 'pymdownx.emoji', # for icons
18
+ ]
19
+
20
+ def on_config(self, config: MkDocsConfig) -> MkDocsConfig:
21
+ extensions = config['markdown_extensions']
22
+ current_extensions = set(extensions)
23
+
24
+ for ext in self._required_extensions:
25
+ if ext not in current_extensions:
26
+ extensions.append(ext)
27
+
28
+ icons_conf = config['mdx_configs'].setdefault('pymdownx.emoji', {})
29
+ icons_conf['emoji_index'] = twemoji
30
+ icons_conf['emoji_generator'] = to_svg
31
+
32
+ theme_features = config['theme']._vars.setdefault('features', [])
33
+
34
+ feature_annotate = 'content.code.annotate'
35
+ if feature_annotate not in theme_features:
36
+ theme_features.append(feature_annotate)
37
+
38
+ return config
@@ -1,2 +0,0 @@
1
-
2
- VERSION = '1.1.0'
@@ -1,8 +0,0 @@
1
- import mkdocs
2
- from mkdocs.plugins import get_plugin_logger
3
-
4
- log = get_plugin_logger(__name__)
5
-
6
-
7
- class ApiDescribedPlugin(mkdocs.plugins.BasePlugin):
8
- ...