MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / _append_entry_line

Function _append_entry_line

scripts/json_to_markdown.py:1066–1091  ·  view source on GitHub ↗

Append a single entry line to the index page. link_prefix: override the relative path prefix for fulltext links. Default "" means use "./{section}/{slug}" (for main index). Pass "./" for sub-pages that are already inside the section dir.

(lines: list, entry: dict, section: str, lang: str,
                       has_fulltext: dict, link_prefix: str = "")

Source from the content-addressed store, hash-verified

1064 page_lines.append(":::")
1065 page_lines.append("")
1066
1067 page_lines.append(FULLTEXT_MARKER)
1068 page_lines.append("")
1069 page_lines.append("---")
1070 page_lines.append("")
1071 ft_heading = "Full Text" if lang == "en" else "全文"
1072 page_lines.append(f"## {ft_heading}")
1073 page_lines.append("")
1074 page_lines.append(_escape_vue_tags(fulltext))
1075 page_lines.append("")
1076 page_lines.append(FULLTEXT_END_MARKER)
1077 page_lines.append("")
1078
1079 page_content = "\n".join(page_lines)
1080 if write_md(page_path, page_content, dry_run):
1081 changed.append(str(page_path.relative_to(ROOT)))
1082 print(f" {'WOULD WRITE' if dry_run else 'WROTE'}: {page_path.relative_to(ROOT)}")
1083
1084 return changed
1085
1086
1087def _append_entry_line(lines: list, entry: dict, section: str, lang: str,
1088 has_fulltext: dict, link_prefix: str = ""):
1089 """Append a single entry line to the index page.
1090
1091 link_prefix: override the relative path prefix for fulltext links.
1092 Default "" means use "./{section}/{slug}" (for main index).
1093 Pass "./" for sub-pages that are already inside the section dir.
1094 """

Callers 1

generate_shared_sectionFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected