mkdocs-techdocs-core 1.4.0__tar.gz → 1.4.2__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,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mkdocs-techdocs-core
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: The core MkDocs plugin used by Backstage's TechDocs as a wrapper around multiple MkDocs plugins and Python Markdown extensions
5
5
  Home-page: https://github.com/backstage/mkdocs-techdocs-core
6
6
  Author: TechDocs Core
7
- Author-email: pulp-fiction@spotify.com
7
+ Author-email: protean@spotify.com
8
8
  License: Apache-2.0
9
9
  Description: # mkdocs-techdocs-core
10
10
 
@@ -33,6 +33,14 @@ Description: # mkdocs-techdocs-core
33
33
  - techdocs-core
34
34
  ```
35
35
 
36
+ (Optional) To use material theme search to generate the `search/search_index.json` (responsible for the search functionality in the TechDocs reader), you need to add the following configuration to your `mkdocs.yml`:
37
+
38
+ ```yaml
39
+ plugins:
40
+ - techdocs-core:
41
+ use_material_search: true
42
+ ```
43
+
36
44
  ## Development
37
45
 
38
46
  ### Running Locally
@@ -149,6 +157,12 @@ Description: # mkdocs-techdocs-core
149
157
 
150
158
  ## Changelog
151
159
 
160
+ ### 1.4.2
161
+ - Fixes an issue where individual extension configurations were being ignored if the extension was included within `pymdownx.extra`. See [#147](https://github.com/backstage/mkdocs-techdocs-core/issues/147)
162
+
163
+ ### 1.4.1
164
+ - Introduced mkdocs-redirects plugin (v`1.2.1`).
165
+
152
166
  ### 1.4.0
153
167
  - Updated minimum mkdocs dependency from `1.5` to `1.6`
154
168
  - Fixes issue [#187](https://github.com/backstage/mkdocs-techdocs-core/issues/187)
@@ -25,6 +25,14 @@ plugins:
25
25
  - techdocs-core
26
26
  ```
27
27
 
28
+ (Optional) To use material theme search to generate the `search/search_index.json` (responsible for the search functionality in the TechDocs reader), you need to add the following configuration to your `mkdocs.yml`:
29
+
30
+ ```yaml
31
+ plugins:
32
+ - techdocs-core:
33
+ use_material_search: true
34
+ ```
35
+
28
36
  ## Development
29
37
 
30
38
  ### Running Locally
@@ -141,6 +149,12 @@ We only use `material-mkdocs` as base styles because Backstage also uses the `Ma
141
149
 
142
150
  ## Changelog
143
151
 
152
+ ### 1.4.2
153
+ - Fixes an issue where individual extension configurations were being ignored if the extension was included within `pymdownx.extra`. See [#147](https://github.com/backstage/mkdocs-techdocs-core/issues/147)
154
+
155
+ ### 1.4.1
156
+ - Introduced mkdocs-redirects plugin (v`1.2.1`).
157
+
144
158
  ### 1.4.0
145
159
  - Updated minimum mkdocs dependency from `1.5` to `1.6`
146
160
  - Fixes issue [#187](https://github.com/backstage/mkdocs-techdocs-core/issues/187)
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mkdocs-techdocs-core
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: The core MkDocs plugin used by Backstage's TechDocs as a wrapper around multiple MkDocs plugins and Python Markdown extensions
5
5
  Home-page: https://github.com/backstage/mkdocs-techdocs-core
6
6
  Author: TechDocs Core
7
- Author-email: pulp-fiction@spotify.com
7
+ Author-email: protean@spotify.com
8
8
  License: Apache-2.0
9
9
  Description: # mkdocs-techdocs-core
10
10
 
@@ -33,6 +33,14 @@ Description: # mkdocs-techdocs-core
33
33
  - techdocs-core
34
34
  ```
35
35
 
36
+ (Optional) To use material theme search to generate the `search/search_index.json` (responsible for the search functionality in the TechDocs reader), you need to add the following configuration to your `mkdocs.yml`:
37
+
38
+ ```yaml
39
+ plugins:
40
+ - techdocs-core:
41
+ use_material_search: true
42
+ ```
43
+
36
44
  ## Development
37
45
 
38
46
  ### Running Locally
@@ -149,6 +157,12 @@ Description: # mkdocs-techdocs-core
149
157
 
150
158
  ## Changelog
151
159
 
160
+ ### 1.4.2
161
+ - Fixes an issue where individual extension configurations were being ignored if the extension was included within `pymdownx.extra`. See [#147](https://github.com/backstage/mkdocs-techdocs-core/issues/147)
162
+
163
+ ### 1.4.1
164
+ - Introduced mkdocs-redirects plugin (v`1.2.1`).
165
+
152
166
  ### 1.4.0
153
167
  - Updated minimum mkdocs dependency from `1.5` to `1.6`
154
168
  - Fixes issue [#187](https://github.com/backstage/mkdocs-techdocs-core/issues/187)
@@ -1,9 +1,10 @@
1
1
  mkdocs>=1.6
2
2
  Markdown<3.4,>=3.2
3
- mkdocs-material==9.5.27
3
+ mkdocs-material==9.5.33
4
4
  markdown_inline_graphviz_extension==1.1.2
5
5
  mkdocs-monorepo-plugin==1.1.0
6
- plantuml-markdown==3.9.7
6
+ plantuml-markdown==3.10.3
7
7
  mdx_truly_sane_lists==1.3
8
8
  pymdown-extensions==10.3.1
9
9
  pygments==2.17.2
10
+ mkdocs-redirects==1.2.1
@@ -9,13 +9,14 @@ Markdown>=3.2,<3.4
9
9
  # pinned to an exact version. Bumps should be accompanied by release notes
10
10
  # explaining what was added or fixed (or at least pointing to the underlying
11
11
  # release notes of the bumped package).
12
- mkdocs-material==9.5.27
12
+ mkdocs-material==9.5.33
13
13
  markdown_inline_graphviz_extension==1.1.2
14
14
  mkdocs-monorepo-plugin==1.1.0
15
- plantuml-markdown==3.9.7
15
+ plantuml-markdown==3.10.3
16
16
  mdx_truly_sane_lists==1.3
17
17
  pymdown-extensions==10.3.1
18
18
  pygments==2.17.2
19
+ mkdocs-redirects==1.2.1
19
20
 
20
21
  # The following are temporary dependencies that are only necessary to work
21
22
  # around incompatible/conflicting underlying dependencies. Each dependency
@@ -28,7 +28,7 @@ with open("requirements.txt") as f:
28
28
 
29
29
  setup(
30
30
  name="mkdocs-techdocs-core",
31
- version="1.4.0",
31
+ version="1.4.2",
32
32
  description="The core MkDocs plugin used by Backstage's TechDocs as a wrapper around "
33
33
  "multiple MkDocs plugins and Python Markdown extensions",
34
34
  long_description=long_description,
@@ -36,7 +36,7 @@ setup(
36
36
  keywords="mkdocs",
37
37
  url="https://github.com/backstage/mkdocs-techdocs-core",
38
38
  author="TechDocs Core",
39
- author_email="pulp-fiction@spotify.com",
39
+ author_email="protean@spotify.com",
40
40
  license="Apache-2.0",
41
41
  python_requires=">=3.7",
42
42
  install_requires=required,
@@ -20,8 +20,10 @@ import os
20
20
  from mkdocs.plugins import BasePlugin
21
21
  from mkdocs.theme import Theme
22
22
  from mkdocs.contrib.search import SearchPlugin
23
+ from material.plugins.search.plugin import SearchPlugin as MaterialSearchPlugin
23
24
  from mkdocs_monorepo_plugin.plugin import MonorepoPlugin
24
25
  from pymdownx.emoji import to_svg
26
+ from pymdownx.extra import extra_extensions
25
27
 
26
28
  log = logging.getLogger(__name__)
27
29
 
@@ -74,9 +76,15 @@ class TechDocsCore(BasePlugin):
74
76
  config["theme"].dirs.append(self.tmp_dir_techdocs_theme.name)
75
77
 
76
78
  # Plugins
79
+ use_material_search = config["plugins"]["techdocs-core"].config.get(
80
+ "use_material_search", False
81
+ )
77
82
  del config["plugins"]["techdocs-core"]
78
83
 
79
- search_plugin = SearchPlugin()
84
+ if use_material_search:
85
+ search_plugin = MaterialSearchPlugin()
86
+ else:
87
+ search_plugin = SearchPlugin()
80
88
  search_plugin.load_config({})
81
89
 
82
90
  monorepo_plugin = MonorepoPlugin()
@@ -107,7 +115,6 @@ class TechDocsCore(BasePlugin):
107
115
  config["markdown_extensions"].append("pymdownx.mark")
108
116
  config["markdown_extensions"].append("pymdownx.smartsymbols")
109
117
  config["markdown_extensions"].append("pymdownx.snippets")
110
- config["markdown_extensions"].append("pymdownx.superfences")
111
118
  config["markdown_extensions"].append("pymdownx.highlight")
112
119
  config["mdx_configs"]["pymdownx.highlight"] = {
113
120
  "linenums": True,
@@ -127,6 +134,17 @@ class TechDocsCore(BasePlugin):
127
134
  }
128
135
  config["markdown_extensions"].append("pymdownx.tilde")
129
136
 
137
+ # merge individual extension configs under the pymdownx.extra extension namespace if individual extension is supplied by pymdownx.extra
138
+ # https://facelessuser.github.io/pymdown-extensions/extensions/extra/
139
+ if "pymdownx.extra" not in config["mdx_configs"]:
140
+ config["mdx_configs"]["pymdownx.extra"] = {}
141
+ for extension in extra_extensions:
142
+ if extension in config["mdx_configs"]:
143
+ config["mdx_configs"]["pymdownx.extra"][extension] = config[
144
+ "mdx_configs"
145
+ ][extension]
146
+ del config["mdx_configs"][extension]
147
+
130
148
  config["markdown_extensions"].append("markdown_inline_graphviz")
131
149
  config["markdown_extensions"].append("plantuml_markdown")
132
150
  config["markdown_extensions"].append("mdx_truly_sane_lists")
@@ -111,3 +111,21 @@ class TestTechDocsCoreConfig(unittest.TestCase):
111
111
  final_config["mdx_configs"]["pymdownx.snippets"]["restrict_base_path"],
112
112
  True,
113
113
  )
114
+
115
+ def test_material_search(self):
116
+ self.plugin_collection["techdocs-core"].load_config(
117
+ {"use_material_search": True}
118
+ )
119
+ final_config = self.techdocscore.on_config(self.mkdocs_yaml_config)
120
+
121
+ self.assertEqual(
122
+ final_config["plugins"]["search"].__module__,
123
+ "material.plugins.search.plugin",
124
+ )
125
+
126
+ def test_default_search(self):
127
+ self.plugin_collection["techdocs-core"].load_config({})
128
+ final_config = self.techdocscore.on_config(self.mkdocs_yaml_config)
129
+ self.assertEqual(
130
+ final_config["plugins"]["search"].__module__, "mkdocs.contrib.search"
131
+ )