fdoc

modulefdoc_project_file

Reading settings from a project file, fpm.toml or a TOML string.

A project file starts with Markdown metadata, optionally between --- lines: key: value lines, with values continued on lines indented by four or more blanks. Metadata ends at the first blank line, at an end marker, or at a line that fits neither form. The rest of the file is the text of the front page. An [extra.ford] table in fpm.toml next to the project file replaces its metadata, as in FORD; the text of the project file is then used whole. An [extra.fdoc] table does the same and comes first, and can give the front page: its text in front_page, or the Markdown file that holds it in front_page_file, relative to fpm.toml.

Uses

Graphs

Uses

Used by

Types

meta_item_tprivate

A metadata key and the values given for it.

metadata_t

The metadata of a project file and what follows it.

Functions

is_markerpureprivate

pure logical function is_marker(line, c)

True if line is three of c, alone or followed by whitespace and anything else.

leading_blankspureprivate

pure integer function leading_blanks(line)

Number of blanks at the start of line.

match_keyprivate

logical function match_key(line, key, value)

True if line is key: value, indented by at most three blanks.

scalar_textprivate

character(len=:) function scalar_text(table, key, kind) result(text)

A string, integer or logical value of table as text.

Subroutines

add_valueprivate

subroutine add_value(meta, key, value, current)

Add a value for key, whose position in meta%items is returned in current.

apply_tableprivate

subroutine apply_table(table, s, stat, errmsg)

Apply the keys of TOML table as options.

apply_toml_string

subroutine apply_toml_string(text, s, stat, errmsg)

Apply --config options: TOML with ; between lines.

array_valuesprivate

subroutine array_values(array, values, stat, errmsg)

The items of a TOML array as text. An array of tables is taken to be extra_filetypes.

load_fpm_settingsprivate

subroutine load_fpm_settings(path, s, found, front, stat, errmsg)

Read the [extra.fdoc] or [extra.ford] table of fpm.toml file path, if there is one.

load_project

subroutine load_project(path, directory, s, body, stat, errmsg)

Read the settings and front page text of the project. Settings come from an [extra.fdoc] or [extra.ford] table in fpm.toml if there is one, and otherwise from the metadata of the project file. With no path the project file is ford.md, if it exists: [extra.fdoc] does not need one, as the text of the front page can be in its front_page, or the file named by front_page_file.

map_valuesprivate

subroutine map_values(table, sep, values)

The string entries of table in the form key<sep>value.

parse_metadata

subroutine parse_metadata(text, meta)

Split project file text into metadata and body.