yodel/format
Types
pub type DetectFunction =
fn(Input) -> Format
pub type FormatDetector {
FormatDetector(name: String, detect: DetectFunction)
}
Constructors
-
FormatDetector(name: String, detect: DetectFunction)
Functions
pub fn get_format(
input: String,
content: String,
options: Options,
formats: List(FormatDetector),
) -> Format
if the user specified a format, use it
otherwise, try to detect the format from the input
if that fails, try to detect the format from the content
and if that fails, return Auto
because we didn’t figure it out