An OKF index.md reserved document (OKF §6).
Index files enumerate a directory's contents for progressive disclosure.
Bundle-root indexes may carry frontmatter solely to declare
okf_version. Nested indexes must not have frontmatter.
Fields
| Field | Type | Description |
|---|---|---|
path | String.t() | Bundle-relative path. Example: "tables/index.md". |
directory | String.t() | Parent directory within the bundle ("" for root). Example: "tables". |
okf_version | String.t() | nil | Declared OKF version from root frontmatter, e.g. "0.1". |
frontmatter | map() | nil | Parsed YAML map when present (root only); otherwise nil. |
body | String.t() | Markdown listing body. |
entries | [t:entry/0] | Parsed bullet entries (* [Title](url) - description). |
links | [ExOKF.Link.t()] | All markdown links found in body. |
raw_frontmatter | String.t() | nil | Original YAML text when the root index declared a version. |
Example
%ExOKF.Index{
path: "index.md",
directory: "",
okf_version: "0.1",
frontmatter: %{"okf_version" => "0.1"},
body: "# Tables\n\n* [Orders](tables/orders.md) - One row per order.\n",
entries: [
%{text: "Orders", target: "tables/orders.md", description: "One row per order."}
],
links: [],
raw_frontmatter: "okf_version: \"0.1\""
}
Summary
Functions
Returns true when this is the bundle-root index.md.
Types
A single bullet entry from an index listing.
:text(String.t()) — link label, e.g."Orders":target(String.t()) — href as written, e.g."orders.md"or"datasets/":description(String.t() \| nil) — optional trailing summary after-
@type t() :: %ExOKF.Index{ body: String.t(), directory: String.t(), entries: [entry()], frontmatter: map() | nil, links: [ExOKF.Link.t()], okf_version: String.t() | nil, path: String.t(), raw_frontmatter: String.t() | nil }
An OKF index document.
See the module documentation for field meanings and a full example.
Functions
Returns true when this is the bundle-root index.md.
Root indexes are those whose directory is "", ".", or "./".
Parameters
index(t/0) — index to inspect
Examples
iex> ExOKF.Index.root?(%ExOKF.Index{path: "index.md", directory: ""})
true
iex> ExOKF.Index.root?(%ExOKF.Index{path: "tables/index.md", directory: "tables"})
false