Rewrite parts of the Header format section

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-11-09 17:26:14 +01:00
parent ffa6e372e1
commit a5d0cd7a74

View file

@ -42,21 +42,22 @@ The following section describe their purpose.
The header format is where imag stores its data. The header is an area at the The header format is where imag stores its data. The header is an area at the
top of every file which is seperated from the content part by three dashes top of every file which is seperated from the content part by three dashes
(`---`). Between these three dashes there is structured data. imag uses `TOML` (`---`). Between these three dashes there is structured data. imag uses `TOML`
as data format for this structured data, because it fits best and the available as data format for this structured data.
`TOML` parser for the rust programming language is really good.
The header can contain any amount of data, but modules (see @sec:modules) are The header can contain any amount of data, but modules (see @sec:modules) are
restricted in their way of altering the data. restricted (by convention) in their way of altering the data.
So normally there are several sections in the header. One section (`[imag]`) is Normally there are several sections in the header. One section (`[imag]`) is
always present. It contains a `version` field, which tells imag which version always present, it is automatically created by the store and contains a
this file was created with. `version` field, which tells imag which version this file was created with.
The store automatically verifies that it is compatible (satisfying semver) with
the version of imag an entry was created with, and if it is not, it fails
loading the entry.
Other sections are named like the modules which created them. Every module is Other sections are named like the modules which created them. Every module is
allowed to store arbitrary data under its own section and a module may never allowed to store arbitrary data under its own section and a module may never
read other sections than its own. read or write other sections than its own.
These conventions are not enforced by imag itself, though.
### Content Format {#sec:thestore:fileformat:content} ### Content Format {#sec:thestore:fileformat:content}