Skip to main content

Module sentinel

Module sentinel 

Source
Expand description

Compatibility re-exports for sentinel primitives now owned by shine-core.

Structs§

Sentinel
A sentinel marker pair, e.g. ("# >>> shine >>>", "# <<< shine <<<").

Enums§

InsertAt
Where to insert a block relative to existing content, for insert_block.

Functions§

extract_block_with_newline
Like find_block, but also includes one trailing '\n' immediately after the end marker if present. The end marker is searched for only after the start marker, so an end marker that appears before the start marker is not matched.
find_block
Returns the substring from the start marker through the end marker (inclusive), or None if either marker is missing. Does not include any trailing newline after the end marker.
insert_block
Inserts block into content, separated from any existing content by exactly one blank line (regardless of whether block or content already end/start with a newline). When content is empty, no leading/trailing blank line is added — the result is just block.
remove_block_bytewise
Byte-offset block removal (shells::profile’s semantics).
remove_block_linewise
Line-based block removal (sys::profile’s semantics).
trim_outer_blank_lines
Trims all leading and trailing '\n' characters (not just one).