Skip to main content

place_agents_block

Function place_agents_block 

Source
pub fn place_agents_block(
    host: &str,
    block: &str,
) -> Result<String, MarkerError>
Expand description

Place an AGENTS.md block into a host, preserving every outside byte.

An existing managed region is replaced; otherwise the block is appended after the host content with one blank line. The block is newline- terminated. host is the current file, or empty when the file is absent.

§Errors

MarkerError::Malformed / MarkerError::OutOfOrder when the host’s existing markers cannot be trusted.