vimsheet.help_registry

Help registry — manages sections, subgroups, and renders help content.

Usage (at module level in any feature file):

from vimsheet.help_registry import register_section, register_help register_section(“NAV”, “Nav”, order=10) register_help(“NAV”, “h / j / k / l”, “Move cursor”, subgroup=”Cursor”, order=10)

Formula functions are auto-populated from the formula registry.

vimsheet.help_registry.register_section(key, label, order=0)[source]

Register a help section (tab).

Parameters:
Return type:

None

vimsheet.help_registry.register_help(section, binding, description, *, order=0, subgroup='')[source]

Register a help entry under section with optional subgroup.

Parameters:
Return type:

None

vimsheet.help_registry.get_tabs()[source]

Return [(section_key, compact_label)] in registration order + function categories.

Return type:

list[tuple[str, str]]

vimsheet.help_registry.get_entries(section)[source]

Return {subgroup_name: [(binding, description)]} for a section.

Parameters:

section (str)

Return type:

dict[str, list[tuple[str, str]]]

vimsheet.help_registry.get_func_categories()[source]

Return [(category_key, label)] for formula function tabs.

Return type:

list[tuple[str, str]]

vimsheet.help_registry.build_section(section, collapsed_groups=None)[source]

Build Rich markup for one section with collapsible subgroup headers.

Parameters:
  • section (str)

  • collapsed_groups (set[str] | None)

Return type:

str

vimsheet.help_registry.section_lines(section, collapsed_groups=None)[source]

Return (rich_markup, [(line_index, binding), …]) for a section.

line_index is the 0-based line number in rich_markup.

Parameters:
  • section (str)

  • collapsed_groups (set[str] | None)

Return type:

tuple[str, list[tuple[int, str]]]

vimsheet.help_registry.build_func_category(category, collapsed=False)[source]

Build Rich markup for one formula function category.

Parameters:
Return type:

str

vimsheet.help_registry.build_search_index(query)[source]

Return {section_key: match_count} for all tabs.

Matches against both binding and description text (case-insensitive).

Parameters:

query (str)

Return type:

dict[str, int]

vimsheet.help_registry.search_matches(query)[source]

Return [(section_key, subgroup, binding, order_index)] for all matches.

order_index is the registration order for stable sorting.

Parameters:

query (str)

Return type:

list[tuple[str, str, str, int]]