feat(tsl-api-reference): expand and reorganize api catalog

Flatten builtin pages, add third-party and platform scopes, and import financial and data warehouse references.

Keep the existing generated index without rebuilding after signature normalization.
This commit is contained in:
csh
2026-08-10 18:26:24 +08:00
parent 2938300acb
commit 9010829c6d
1186 changed files with 243901 additions and 219769 deletions
+22 -4
View File
@@ -28,10 +28,10 @@ class FunctionIndexTest(unittest.TestCase):
self.skill_dir = Path(self.temp_dir.name) / "tsl-api-reference"
self.codegen_root = self.skill_dir / "references" / "codegen"
self.data_dir = self.skill_dir / "data"
leaf = self.codegen_root / "builtin" / "base" / "array.md"
leaf = self.codegen_root / "builtin" / "array.md"
leaf.parent.mkdir(parents=True)
leaf.write_text(
"# Builtin - 基础 / 数组\n\n"
"# Builtin - 数组\n\n"
"## `demo()`\n\n"
"声明:function\n\n"
"返回示例值。\n\n"
@@ -71,6 +71,24 @@ class FunctionIndexTest(unittest.TestCase):
self.assertEqual("数组 列表", row["tags"])
self.assertEqual("返回示例值。", row["summary"])
def test_root_page_uses_file_stem_for_scope_and_module(self):
self.write_page(
"deprecated.md",
"# Deprecated\n\n"
"## `legacy()`\n\n"
"声明:function\n\n"
"已废弃。\n",
)
rows = {
row[0]: dict(zip(self.module.HEADER, row))
for row in self.module.build_rows(self.codegen_root)
}
self.assertEqual("deprecated", rows["legacy"]["scope"])
self.assertEqual("deprecated", rows["legacy"]["module"])
self.assertEqual("deprecated.md", rows["legacy"]["page"])
def test_declaration_does_not_become_a_missing_description_summary(self):
self.write_page(
"project/missing_description.md",
@@ -113,9 +131,9 @@ class FunctionIndexTest(unittest.TestCase):
[
"demo",
"builtin",
"base",
"array",
"demo()",
"builtin/base/array.md",
"builtin/array.md",
"demo",
"数组 列表",
"返回示例值。",