Skip to main content

parse_named

Function parse_named 

Source
pub fn parse_named(
    input: &str,
    format: Format,
    name: &str,
) -> Result<Changelog, ParseError>
Expand description

Parse with an optional source filename’s semantic information, without I/O.

Towncrier fragment names such as 123.bugfix.rst select fragment parsing and supply the issue and category absent from the body. Other formats ignore name. Ordinary history filenames such as NEWS.rst do not select fragment mode. Use parse when the name is unavailable; unnamed fragments retain their content without inventing a type. A named misc fragment may have an empty body.

§Errors

Returns the same errors as parse, and a malformed-input error for an invalid Towncrier fragment name. name is interpreted as a filename, not opened.