Concurrent filesystem parser for OKF bundles.
Walks a directory tree, parses markdown files with Task.async_stream,
classifies reserved documents (index.md, log.md), extracts relative
links, and builds an ExOKF.Bundle.
Individual file failures become diagnostics rather than aborting the load, matching OKF's permissive consumption model.
Summary
Functions
Loads an OKF bundle from the directory at root.
Types
@type option() :: {:max_concurrency, pos_integer()} | {:timeout, timeout()} | {:build_graph, boolean()}
Options accepted by load/2.
{:max_concurrency, pos_integer()}— max parallel parse tasks (defaultSystem.schedulers_online()){:timeout, timeout()}— per-task timeout (default:infinity){:build_graph, boolean()}— index the link graph after load (defaulttrue)
Functions
@spec load(String.t(), [option()]) :: {:ok, ExOKF.Bundle.t()} | {:error, term()}
Loads an OKF bundle from the directory at root.
Returns {:ok, bundle} even when warnings or per-file parse errors are
present. Only a non-directory root yields {:error, reason}.
Parameters
root(String.t()) — path to the bundle directoryopts([t:option/0]) — load options (seeoption/0)
Returns
{:ok, ExOKF.Bundle.t()}— loaded bundle (may contain diagnostics){:error, {:not_a_directory, String.t()}}—rootis not a directory
Examples
iex> {:ok, bundle} = ExOKF.Parser.load(ExOKF.TestSupport.minimal_fixture_path())
iex> ExOKF.Bundle.has_concept?(bundle, "hello")
true
iex> {:ok, bundle} = ExOKF.Parser.load(ExOKF.TestSupport.sample_fixture_path(), build_graph: false)
iex> bundle.graph
nil