MCPcopy Index your code
hub / github.com/google/python-fire / _rst_section

Function _rst_section

fire/docstrings.py:705–721  ·  view source on GitHub ↗

Checks whether the current line is the start of a new RST-style section. RST uses directives to specify information. An RST directive, which we refer to as a section here, are surrounded with colons. For example, :param name:. Args: line_info: Information about the current line. Return

(line_info)

Source from the content-addressed store, hash-verified

703
704
705def _rst_section(line_info):
706 """Checks whether the current line is the start of a new RST-style section.
707
708 RST uses directives to specify information. An RST directive, which we refer
709 to as a section here, are surrounded with colons. For example, :param name:.
710
711 Args:
712 line_info: Information about the current line.
713 Returns:
714 A Section type if one matches, or None if no section type matches.
715 """
716 directive = _get_directive(line_info)
717 if directive:
718 possible_title = directive.split()[0]
719 return _section_from_possible_title(possible_title)
720 else:
721 return None
722
723
724def _line_is_hyphens(line):

Callers 1

_update_section_stateFunction · 0.85

Calls 2

_get_directiveFunction · 0.85

Tested by

no test coverage detected