♻️ refactor(tsl-api): tighten docs and retire stale tests

This commit is contained in:
csh
2026-08-21 10:11:48 +08:00
parent 2e8c46e152
commit 5484fc7519
24 changed files with 505 additions and 2700 deletions
@@ -602,6 +602,11 @@ def _markdown_cell(value: str) -> str:
return value.replace("|", "\\|").replace("\n", "<br>")
def _render_note(note: str) -> str:
"""Keep source numbering as text instead of creating a nested list."""
return re.sub(r"^(\s*\d+)[.]", r"\1\\.", note)
def render_dictionary_page(page: DictionaryPage) -> str:
path = " / ".join((*page.source_path, page.title))
lines = [f"# 天软数据字典 / {path}", "", f"类型:{page.kind}", "", "## 表信息", ""]
@@ -632,7 +637,7 @@ def render_dictionary_page(page: DictionaryPage) -> str:
if page.notes or page.table.update_info:
lines.extend(["", "## 数据说明", ""])
for note in (*page.notes, *page.table.update_info):
lines.append(f"- {note}")
lines.append(f"- {_render_note(note)}")
if page.examples:
lines.extend(["", "## 取数示例", ""])
for index, example in enumerate(page.examples, start=1):