Expand description
Document metadata (#679): what a file says about itself — an EPUB’s
Dublin Core, an Office package’s core and application properties, an
ODF meta.xml, a photo’s EXIF, an audio file’s tags, a PDF’s Info
dictionary — read into DocumentMetadata on the document, and written
out on request as a metadata object in the JSON or as YAML front
matter at the top of the Markdown (MetadataOutput). Nothing is
written by default, so every export stays byte for byte what it was.
The common fields are the ones every source has a name for (a title,
authors, a subject, keywords, dates, the tool that wrote the file); what
only one kind of file carries keeps its own names in a section of its
own: exif (the tag names as exiftool prints them: DateTimeOriginal,
Make, Model, …), audio (album, artist, genre, duration,
…), properties (the rest of an Office package’s properties:
revision, category, pages, …) and a decoded gps position.
Under the PII pass (redact_pii) the author fields are masked as
persons and the position is dropped; see crate::redact.
Structs§
- Document
Metadata - The metadata of a document. Every field is optional; a document whose
file carries nothing has the default,
is_empty. Dates are kept as the file wrote them, normalized to ISO 8601 where the format defines one (Office and ODFdctermsdates, a PDF’sD:dates); EXIF’s ownYYYY:MM:DD HH:MM:SSstays as it is inexifand is turned into ISO 8601 fordate. - GpsPosition
- A decoded GPS position (EXIF
GPSLatitude/GPSLongitude/GPSAltitudewith their reference hemispheres applied): signed decimal degrees, metres above sea level.
Enums§
- Metadata
Output - Where the metadata goes in the exports.
None(the default) keeps it to the in-memory document;Jsonadds ametadataobject to the docling JSON (afterorigin);Frontmatteropens the Markdown with a YAML front matter block as well.