pub fn is_markdown_file(path: &Path) -> boolExpand description
Check if a path represents a Markdown file based on its extension.
This function validates file paths to determine if they should be treated as Markdown files. It performs case-insensitive extension checking to support different naming conventions across platforms.
§Supported Extensions
.md(most common).markdown(verbose form)- Case variations:
.MD,.Markdown, etc.
§Arguments
path- The file path to check
§Returns
trueif the file has a recognized Markdown extensionfalseotherwise (including files with no extension)
§Examples
assert!(is_markdown_file(Path::new("agent.md")));
assert!(is_markdown_file(Path::new("README.MD")));
assert!(is_markdown_file(Path::new("guide.markdown")));
assert!(!is_markdown_file(Path::new("config.toml")));
assert!(!is_markdown_file(Path::new("script.sh")));
assert!(!is_markdown_file(Path::new("no-extension")));