Expand description
The metadata written as data: how a program that holds the author’s metadata as a
map of data values (for example the root keys of a front matter) makes the
document’s DocMeta from it, with DocMeta::from_data.
The form is the same for every program:
| Key | Its value |
|---|---|
TITLE_KEY (title) | one text |
AUTHOR_KEY (author) | one author, or a list of authors |
DATE_KEY (date) | one text |
| any other key | any data, kept in DocMeta::other |
An author (MetaAuthor) is a text, the author’s name, or a map:
| Key | Its value |
|---|---|
NAME_KEY (name) | one text; required |
AFFILIATION_KEY (affiliation) | one text, or a list of texts |
EMAIL_KEY (email) | one text, a plain address |
NOTE_KEY (note) | one text, or a list of texts |
| any other key | any data, kept in MetaAuthor::other |
author:
- name: 'Ada Lovelace'
affiliation: ['University of X', 'Institute of Y']
email: 'ada@example.com'
note: 'Corresponding author'
- 'Grace Hopper'Where a text is expected, a number or a truth value is read as the text it is
written as (date: 2026 is the text 2026). A value of another shape, and an
author’s map without name, are errors (MetaDataError). The texts are FLM,
parsed when the document is processed, except the email address, which is not
parsed. metadata_schema describes the same form as a JSON Schema.
Structs§
- Meta
Data Error - A value of the metadata’s data that is not of the form the module
documentation states: where it is, and what is wrong. It is displayed
as its
detail. - Meta
Path - Where a value is in the metadata’s data: its key, then the steps from the key’s
value down to the value (
MetaStep). It is displayed as the key and the steps joined by.:author.1for the second author of a list,author.0.affiliationfor the affiliations of the first, and the key alone for the key’s own value.
Enums§
Constants§
- AFFILIATION_
KEY - The key of an author’s affiliations in an author’s map,
affiliation: one text, or a list of texts. - AUTHOR_
KEY - The key of the authors,
author: one author, or a list of authors, each a text (the author’s name) or a map (see the module documentation). - DATE_
KEY - The key of the date,
date: one text, as the author writes the date. - EMAIL_
KEY - The key of an author’s email address in an author’s map,
email: one text, a plain address. - NAME_
KEY - The key of an author’s name in an author’s map,
name: one text, required. - NOTE_
KEY - The key of the notes about an author in an author’s map,
note: one text, or a list of texts. - TITLE_
KEY - The key of the title,
title: one text.
Functions§
- metadata_
schema - Returns the JSON Schema of the metadata written as data, in the form the
module documentation states: a map in which
TITLE_KEYandDATE_KEYhold texts,AUTHOR_KEYone author or a list of authors, and any other key any value. The schema refers to no definition of its own. A program uses it to describe the files in which authors write metadata, for example to an editor that checks them.