📝 docs(tsl): sync api skill with corrected codegen
Mirror docs/tsl/codegen into the bundled tsl-api-reference skill and rebuild the function index. Remove invalid duplicate API entries for cb_delistedbydate, createhttpsession, exportJsonString, and Anova_Bartlett so exact lookup returns the canonical entries.
This commit is contained in:
@@ -5,7 +5,8 @@ import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ENTRY_RE = re.compile(r"^#{2,3}(?!#)\s+`(.+?)`\s*$")
|
||||
ENTRY_RE = re.compile(r"^(#{2,3})(?!#)\s+`(.+?)`\s*$")
|
||||
HEADING_RE = re.compile(r"^(#{1,6})(?!#)\s+")
|
||||
SKILL_ROOT = Path(__file__).resolve().parents[1]
|
||||
DEFAULT_TSV = SKILL_ROOT / "data" / "function_index.tsv"
|
||||
DEFAULT_CODEGEN_ROOT = SKILL_ROOT / "references" / "codegen"
|
||||
@@ -70,15 +71,21 @@ def slice_entry(codegen_root, page, signature):
|
||||
start = None
|
||||
for idx, line in enumerate(lines):
|
||||
match = ENTRY_RE.match(line)
|
||||
if match and match.group(1) == signature:
|
||||
if match and match.group(2) == signature:
|
||||
start = idx
|
||||
start_level = len(match.group(1))
|
||||
break
|
||||
if start is None:
|
||||
return ""
|
||||
|
||||
end = len(lines)
|
||||
for idx in range(start + 1, len(lines)):
|
||||
if ENTRY_RE.match(lines[idx]):
|
||||
entry_match = ENTRY_RE.match(lines[idx])
|
||||
if entry_match:
|
||||
end = idx
|
||||
break
|
||||
heading_match = HEADING_RE.match(lines[idx])
|
||||
if heading_match and len(heading_match.group(1)) <= start_level:
|
||||
end = idx
|
||||
break
|
||||
block = lines[start:end]
|
||||
|
||||
Reference in New Issue
Block a user