Skip to content

Commit

Permalink
parse also *.yml file suffix as YAML; closes #1958 (#1959)
Browse files Browse the repository at this point in the history
previously only files with *.yaml suffix were recognized as YAML
  • Loading branch information
bast authored and Keats committed Aug 14, 2022
1 parent abafe66 commit f61e1ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/templates/src/global_fns/load_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/documentation/templates/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f61e1ba

Please sign in to comment.