pub struct MD040Config {
pub style: LanguageStyle,
pub preferred_aliases: HashMap<String, String>,
pub allowed_languages: Vec<String>,
pub disallowed_languages: Vec<String>,
pub unknown_language_action: UnknownLanguageAction,
pub custom_languages: Vec<String>,
}Expand description
Configuration for MD040 (Fenced code language)
Fields§
§style: LanguageStyleLanguage normalization style
preferred_aliases: HashMap<String, String>Override preferred label for specific languages Keys: Linguist canonical names (case-insensitive), Values: preferred alias
allowed_languages: Vec<String>Only allow these languages (empty = allow all) Uses Linguist canonical language names (case-insensitive)
disallowed_languages: Vec<String>Block these languages (ignored if allowed_languages is non-empty) Uses Linguist canonical language names (case-insensitive)
unknown_language_action: UnknownLanguageActionAction for unknown language labels not in Linguist
custom_languages: Vec<String>Languages Linguist does not know that this project uses anyway Matched against fence labels case-insensitively
Implementations§
Source§impl MD040Config
impl MD040Config
Sourcepub fn custom_language(&self, label: &str) -> Option<&str>
pub fn custom_language(&self, label: &str) -> Option<&str>
The spelling custom-languages declares for label, if it declares one.
Sourcepub fn preferred_alias_problem(
&self,
language: &str,
alias: &str,
) -> Option<String>
pub fn preferred_alias_problem( &self, language: &str, alias: &str, ) -> Option<String>
Why preferred-aliases cannot make alias stand for language, when it cannot.
This is the single definition of a usable entry: it both phrases the configuration error and decides whether the entry is honored, so a label the user is told is invalid is never one that gets suggested or written.
Sourcepub fn preferred_label(&self, language: &str) -> Option<&str>
pub fn preferred_label(&self, language: &str) -> Option<&str>
The label preferred-aliases sets for language, when it sets a usable one.
Trait Implementations§
Source§impl Clone for MD040Config
impl Clone for MD040Config
Source§fn clone(&self) -> MD040Config
fn clone(&self) -> MD040Config
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more