|
@@ -16,7 +16,8 @@ def check_md_content(md_file):
|
|
|
success = False
|
|
|
return
|
|
|
|
|
|
- md_content = open(md_file, 'r').read()
|
|
|
+ md_content = re.sub(r'<!--([\s\S]*?)-->', '', open(md_file, 'r').read())
|
|
|
+
|
|
|
if 'ee' in directory_file:
|
|
|
md_content = re.sub(r'{% emqxce %}([\s\S]*?){% endemqxce %}', '', md_content)
|
|
|
else:
|
|
@@ -27,7 +28,7 @@ def check_md_content(md_file):
|
|
|
for url in url_list:
|
|
|
if url[0].endswith('!'):
|
|
|
continue
|
|
|
- if url[2].startswith(('http://', 'https://', '<', '#', 'mailto:')) or url[2].find('.md') == -1:
|
|
|
+ if url[2].startswith(('http://', 'https://', '<', '#', 'mailto:', 'tel:')):
|
|
|
continue
|
|
|
url_path = url[2].split('.md')[0]
|
|
|
ref_md_path = os.path.join(f'{"/".join(md_file.split("/")[:-1])}/', f'{url_path}.md')
|
|
@@ -56,13 +57,8 @@ def get_md_files(dir_config, path):
|
|
|
for i in dir_config:
|
|
|
md_name = i.get('path')
|
|
|
md_children = i.get('children')
|
|
|
- if md_name and md_children:
|
|
|
- print(f'{i.get("title")} has path and children')
|
|
|
- success = False
|
|
|
|
|
|
- if md_children:
|
|
|
- md_list += get_md_files(md_children, path)
|
|
|
- else:
|
|
|
+ if md_name:
|
|
|
if md_name.startswith(('http://', 'https://')):
|
|
|
continue
|
|
|
elif md_name == './':
|
|
@@ -70,6 +66,9 @@ def get_md_files(dir_config, path):
|
|
|
else:
|
|
|
md_list.append(f'{docs_path}/{path}/{md_name}.md')
|
|
|
|
|
|
+ if md_children:
|
|
|
+ md_list += get_md_files(md_children, path)
|
|
|
+
|
|
|
return list(set(md_list))
|
|
|
|
|
|
|