FormatParser.Document (format_parser v2.6.0)
A Document struct and functions.
The Document struct contains the fields format and nature.
Summary
Functions
Parses a document from the given input.
Types
Functions
Parses a document from the given input.
- If the input is a tuple
{:error, file}wherefileis a binary, it attempts to parse the document from the file. - If the input is a binary
file, it attempts to parse the document from the file. - For any other input, it returns the input as-is.
Examples
iex> parse({:error, "path/to/file"}) # Parses the document from the given file
iex> parse("path/to/file") # Parses the document from the given file
iex> parse(:ok) :ok