Struct MDBOOK001

Source
pub struct MDBOOK001;
Expand description

MDBOOK001: Code blocks should have language tags

This rule is triggered when code blocks don’t have language tags for syntax highlighting. Proper language tags help with documentation clarity and proper rendering in mdBook.

Trait Implementations§

Source§

impl AstRule for MDBOOK001

Source§

fn id(&self) -> &'static str

Unique identifier for the rule (e.g., “MD001”)
Source§

fn name(&self) -> &'static str

Human-readable name for the rule (e.g., “heading-increment”)
Source§

fn description(&self) -> &'static str

Description of what the rule checks
Source§

fn metadata(&self) -> RuleMetadata

Metadata about this rule’s status and properties
Source§

fn check_ast<'a>( &self, document: &Document, ast: &'a AstNode<'a>, ) -> Result<Vec<Violation>>

Check a document using its AST
Source§

fn can_fix(&self) -> bool

Whether this rule can automatically fix violations
Source§

fn fix(&self, _content: &str, _violation: &Violation) -> Option<String>

Attempt to fix a violation (if supported)
Source§

fn create_violation( &self, message: String, line: usize, column: usize, severity: Severity, ) -> Violation

Create a violation for this rule

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Rule for T
where T: AstRule,

Source§

fn id(&self) -> &'static str

Unique identifier for the rule (e.g., “MD001”)
Source§

fn name(&self) -> &'static str

Human-readable name for the rule (e.g., “heading-increment”)
Source§

fn description(&self) -> &'static str

Description of what the rule checks
Source§

fn metadata(&self) -> RuleMetadata

Metadata about this rule’s status and properties
Source§

fn check_with_ast<'a>( &self, document: &Document, ast: Option<&'a Node<'a, RefCell<Ast>>>, ) -> Result<Vec<Violation>, MdBookLintError>

Check a document for violations of this rule with optional pre-parsed AST
Source§

fn check(&self, document: &Document) -> Result<Vec<Violation>, MdBookLintError>

Check a document for violations of this rule (backward compatibility)
Source§

fn can_fix(&self) -> bool

Whether this rule can automatically fix violations
Source§

fn fix(&self, content: &str, violation: &Violation) -> Option<String>

Attempt to fix a violation (if supported)
Source§

fn create_violation( &self, message: String, line: usize, column: usize, severity: Severity, ) -> Violation

Create a violation for this rule
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.