Просмотр исходного кода

update: wiki文档rst文件换用markdown文件

chenxuuu 2 лет назад
Родитель
Сommit
8106e14439
2 измененных файлов с 7 добавлено и 8 удалено
  1. 2 4
      tools/documentGenerator.py
  2. 5 4
      tools/make_doc_file.py

+ 2 - 4
tools/documentGenerator.py

@@ -54,8 +54,7 @@ s = io.open(snippet_path,"w")
 s.write(json.dumps(snippet))
 s.close()
 
-make_doc_file.make("../../luatos-wiki/api/",modules,"🍴 LuatOS-SOC接口文档\n"+
-                                                    "==============\n\n")
+make_doc_file.make("../../luatos-wiki/api/",modules,"# 🍴 LuatOS-SOC接口文档\n")
 
 
 
@@ -63,5 +62,4 @@ make_doc_file.make("../../luatos-wiki/api/",modules,"🍴 LuatOS-SOC接口文档
 modules = api_get.get_modules(api_get.get_file_list([source_path+"/../script/libs"]))
 modules.extend(api_get.get_modules(api_get.get_file_list([source_path+"/../script/libs"],".lua"),"--[[","]]"))
 
-make_doc_file.make("../../luatos-wiki/api/libs/",modules,"🥢 扩展库接口文档\n"+
-                                                        "==============\n\n")
+make_doc_file.make("../../luatos-wiki/api/libs/",modules,"# 🥢 扩展库接口文档\n")

+ 5 - 4
tools/make_doc_file.py

@@ -80,15 +80,16 @@ def make(path,modules,index_text):
                     doc.write("|X")
             doc.write("|\n")
         doc.close()
-    doc = open(path+"index.rst", "a+",encoding='utf-8')
+    doc = open(path+"index.md", "a+",encoding='utf-8')
     doc.write(index_text)
     # 创建toctree
     doc.write("\n\n请点击左侧列表,查看各个接口。如需搜索,请使用F5进行搜索。\n\n"+
-                                                    ".. toctree::\n\n")
+                                                    "```{toctree}\n")
     if is_api:
-        doc.write("   supported\n")
+        doc.write("supported\n")
     for module in modules:
-        doc.write("   "+module["module"]+"\n")
+        doc.write(module["module"]+"\n")
+    doc.write("```\n")
     doc.close()
 
     for module in modules: