Skip to content

Commit c1d2642

Browse files
mwasilewroxell
authored andcommitted
docs: fix automated docs generation
New version of material theme and plugins breaks when there is empty "tags" stanza in the metadata section of the markdown. This patch only adds "tags" if there are any to add. Second issue fixed is adding an empty tags.md file which is now required to present collected tags in the generated docs. Signed-off-by: Milosz Wasilewski <milosz.wasilewski@foundries.io>
1 parent c5d7d2d commit c1d2642

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

docs/tags.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Tags
2+
3+
<!-- material/tags -->

mkdocs.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ plugins:
1111
- 'automated/linux'
1212
- 'automated/android'
1313
- 'manual'
14-
- tags
14+
- tags:
15+
tags_file: tags.md
1516
- exclude:
1617
glob:
1718
- plans/*

mkdocs_plugin/testdefinitionsmkdocs/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ def generate_yaml_markdown(self, filename, config):
5151
mdFile = mdutils.MdUtils(file_name=tmp_filename)
5252
tags_section = "---\n"
5353
tags_section += "title: %s\n" % metadata["name"]
54-
tags_section += "tags:\n"
5554
scope_list = metadata.get("scope", [])
5655
os_list = metadata.get("os", [])
5756
device_list = metadata.get("devices", [])
58-
if scope_list is not None:
57+
if scope_list:
58+
tags_section += "tags:\n"
5959
for item in scope_list:
6060
tags_section += " - %s\n" % item
6161
tags_section += "---\n"

0 commit comments

Comments
 (0)