MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / _insert_section_entry

Function _insert_section_entry

openkb/agent/compiler.py:885–893  ·  view source on GitHub ↗

Insert a new entry at the top of a specific section.

(lines: list[str], heading: str, entry: str)

Source from the content-addressed store, hash-verified

883
884
885def _insert_section_entry(lines: list[str], heading: str, entry: str) -> bool:
886 """Insert a new entry at the top of a specific section."""
887 bounds = _get_section_bounds(lines, heading)
888 if bounds is None:
889 return False
890
891 start, _ = bounds
892 lines.insert(start, entry)
893 return True
894
895
896def _remove_section_entry(lines: list[str], heading: str, link: str) -> bool:

Callers 3

_backlink_summary_pagesFunction · 0.85
_backlink_pagesFunction · 0.85
_update_indexFunction · 0.85

Calls 1

_get_section_boundsFunction · 0.85

Tested by

no test coverage detected