ftd::p1
grammarftd
is based on a low-level grammar called ftd::p1
grammar.section
ftd::p1
file is composed of “sections”. A section looks like this:ftd::p1
file with two sections-- some section: the caption of the section header-1: some header value hello: world the body of the first section -- something: yo: 42
--
. The section has these properties:
section name
--
, and ends with the first :
. Trailing :
is mandatory. In our example, the name of the first section is some section
, and the second section’s name is something
.
Section name contains alphanumeric characters, underscores, space, dots(.
), hash(#
), and hyphens(-
). Colon terminates the section name.
Leading and trailing whitespaces are not considered part of the section name.
section caption
:
in the section line, till the end of the first line is called the caption
of the section. The caption
is optional.
In our example, the first section’s caption is “the caption of the section”, and the second section does not have a caption.
Leading and trailing whitespaces are not considered part of the caption.
section headers
--
, zero or more section headers can be passed. In our example, the first section has two headers, header-1
and hello
, with values some header value
and world
respectively. An empty newline or the start of a new section marks the end of the headers.
Leading and trailing whitespaces of both header name and header value are ignored.
section body
The body is optional.
Leading and trailing newlines are not considered part of the body.
-- some-section: optional body of "some-section" this one has a body
ftd::p1
module in ftd
crate can be used to read ftd.p1
files. Wrappers of this crate in Python and other programming languages would hopefully come soon.ftd::p1
should come up with their own extension, but .p1
is an extension which can be used by convention in some cases. Also consider using ftd
itself, instead of this low-level library, this library should only be used as a fallback.