Skip to main content

get_recipe

Function get_recipe 

Source
pub fn get_recipe(
    base_path: &Utf8Path,
    name: &str,
) -> Result<RecipeEntry, CoreError>
Expand description

Look name up under base_path, returning the file it resolves to.

name may be a path or a bare recipe name, with or without an extension — cooklang-find tries .cook and .menu for the latter. A leading ./ is stripped first, because cooklang-find does not expect it.

§Errors

  • CoreError::RecipeNotFound if nothing matches. Reserved for genuine absence, so that a caller told “not found” does not go looking for a file that is sitting right there.
  • CoreError::Io if a match was found but could not be opened or its front matter could not be understood. The cause is in source.