fromPath static method
Infers the DocType from a file path extension. Throws ArgumentError if the extension is unrecognised.
Implementation
static DocType fromPath(String filePath) {
final ext = filePath.split('.').last.toLowerCase();
return DocType.fromExtension(ext);
}