Metadata declaration @ …
Metadata is data about data. Specifically, metadata is information about the actual content of a file or webpage. This can include various aspects such as the name of the author who wrote it, the language it is written in, a link to where one can subscribe to updates or technical instructions on how the content shall be styled.
In Aneamal, metadata is declared by assigning a metadata value to a metadata name. The Aneamal Translator recognizes a few dozen names. But you can also assign values to freely chosen names which essentially serve as variables. Metadata can be passed on to other files and can be inserted in the actual content.
How to
A metadata declaration is marked with a squirrel @
at the beginning of each line. The lines contain a metadata name and a value that is assigned to it. Values come in three flavors – text, links and embedded files – that are assigned in slightly different ways.
Metadata declarations can occur everywhere in a file. They are always processed before the file’s actual content. So even metadata declared at the end of a file can be used in a paragraph at its start.
Metadata can be declared in any Aneamal file. Additionally, the @meta.nml file is for centralized settings: its declarations are passed on to all Aneamal files in the same directory and all of its sub-directories that do not have an own @meta.nml file. @meta.nml files may only contain metadata declarations and other ghost markup.
Inheritance
Metadata that has been declared in an @meta.nml file is automatically inherited by Aneamal files in the same directory or sub-directories without own @meta.nml file unless they explicitly opt out. Furthermore, @header.nml, @aside.nml, @footer.nml as well as linked and embedded files and quotation blocks inherit metadata from the containing file.
The following example uses metadata to store the meaning of acronyms from a European Space Agency mission. JUICE is declared in the main file, PRIDE in a quotation block therein. PRIDE will be available in the quotation block only, but JUICE will be available in both the main file and the quotation block, since the quotation block inherits metadata from the main file.
@ JUICE: Jupiter Icy Moons Explorer
> @ PRIDE: Planetary Radio Interferometer and Doppler Experiment
> …
But metadata is not just passed on by the file in which it is declared. Inherited metadata is also passed on. For instance, a quotation block inside an embedded file inside @aside.nml, which is implicitly integrated into a webpage alongside the main Aneamal file requested by a reader, could inherit metadata from all four Aneamal files that are further up in the chain:
- @meta.nml
- the requested Aneamal file
- @aside.nml
- embedded file
- quotation block
- embedded file
- @aside.nml
- the requested Aneamal file