From f61e1ba9a2deeec08e978ee405cdee81111a3201 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Wed, 10 Aug 2022 23:34:12 +0200 Subject: [PATCH] parse also *.yml file suffix as YAML; closes #1958 (#1959) previously only files with *.yaml suffix were recognized as YAML --- components/templates/src/global_fns/load_data.rs | 2 +- docs/content/documentation/templates/overview.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/templates/src/global_fns/load_data.rs b/components/templates/src/global_fns/load_data.rs index dc6c4210b8..c719495f70 100644 --- a/components/templates/src/global_fns/load_data.rs +++ b/components/templates/src/global_fns/load_data.rs @@ -61,7 +61,7 @@ impl FromStr for OutputFormat { "bibtex" => Ok(OutputFormat::Bibtex), "xml" => Ok(OutputFormat::Xml), "plain" => Ok(OutputFormat::Plain), - "yaml" => Ok(OutputFormat::Yaml), + "yaml" | "yml" => Ok(OutputFormat::Yaml), format => Err(format!("Unknown output format {}", format).into()), } } diff --git a/docs/content/documentation/templates/overview.md b/docs/content/documentation/templates/overview.md index 0e1f17dfaf..b48e8ffb53 100644 --- a/docs/content/documentation/templates/overview.md +++ b/docs/content/documentation/templates/overview.md @@ -259,7 +259,7 @@ The method returns a map containing `width`, `height` and `format` (the lowercas ### `load_data` -Loads data from a file, URL, or string literal. Supported file types include *toml*, *json*, *csv*, *bibtex*, *yaml* +Loads data from a file, URL, or string literal. Supported file types include *toml*, *json*, *csv*, *bibtex*, *yaml*/*yml*, and *xml* and only supports UTF-8 encoding. Any other file type will be loaded as plain text.