duat-filetype

Crates.ioduat-filetype
lib.rsduat-filetype
version0.3.0
created_at2025-06-16 06:04:55.406606+00
updated_at2025-08-20 13:37:51.697234+00
descriptionFiletype detection for the File widget from Duat
homepagehttps://github.com/AhoyISki/duat-filetype
repository
max_upload_size
id1713927
size150,105
ahoyiski (AhoyISki)

documentation

README

duat-filetype License: AGPL-3.0-or-later duat-filetype on crates.io duat-filetype on docs.rs

Filetypes for the Duat text editor

This Plugin is included by default, as it is considered a core utility of duat. It adds the two following traits:

Both of these traits are included by default in Duat’s prelude, but if you want to use them in a plugin, first, add duat-filetype to the dependencies:

cargo add duat-filetype

Or, for latest git version:

cargo add --git https://github.com/AhoyISki/duat-filetype

Then, just use it in the file:

use duat_filetype::FileType;

fn is_toml(file_name: &str) -> bool {
    file_name.filetype() == Some("toml")
}
Commit count: 0

cargo fmt