Expand description
Parse existing changelogs without filesystem access.
Parsing preserves source order and Markdown. Convention checks are a separate operation: invalid dates, for example, remain available for inspection.
use logloom::{parse, validate, Format};
let changelog = parse("# Changelog\n\n## [Unreleased]\n\n### Added\n- A library.\n",
Format::KeepAChangelog)?;
assert_eq!(changelog.releases.len(), 1);
assert!(validate(&changelog).is_empty());
let json = serde_json::to_string(&changelog)?;Structs§
- Changelog
- An owned, serializable changelog independent of its source format.
- Diagnostic
- A convention check result with a one-based source line when available.
- Entry
- A top-level list item, Markdown block, or raw text block within a section.
- Link
Definition - One effective
CommonMarklink definition; duplicate definitions remain insource. - Metadata
- Document-level information; arbitrary metadata stays in the introduction.
- Parse
Error - A structured parsing failure with an optional one-based source line.
- Release
- A release identifier is opaque: neither
SemVernor chronological sorting is imposed. - Section
- A group of ordered entries.
- Span
- Half-open UTF-8 byte offsets in the original source, plus a one-based line.
Enums§
- Category
- A normalized category with a lossless fallback for other names.
- Detection
Error - A conservative format detector’s failure, separate from convention validation.
- Diagnostic
Code - Stable machine-readable convention diagnostic codes.
- Entry
Kind - Structural origin of an entry.
- Error
Kind - Classification of a parsing failure, independent of its human-readable text.
- Format
- Supported input formats. More formats may be added in future releases.
- Severity
- Importance of a convention diagnostic. Parsing itself has already succeeded.
Constants§
- MAX_
INPUT_ BYTES - Maximum UTF-8 input size (16 MiB), enforced before Markdown parsing.
Functions§
- detect
- Detect a format from specific content signatures without I/O or validation.
- detect_
named - Detect with a filename hint for numeric or anonymous Towncrier fragments.
- parse
- Parse an in-memory document, retaining its original content and ordering.
- parse_
named - Parse with an optional source filename’s semantic information, without I/O.
- validate
- Check the source format’s conventions without mutating or sorting content.
- validate_
for_ format - Validate with the conventions of the selected input format.