Module inline_config

Module inline_config 

Source
Expand description

Inline configuration comment handling for markdownlint compatibility

Supports:

  • <!-- markdownlint-disable --> - Disable all rules from this point
  • <!-- markdownlint-enable --> - Re-enable all rules from this point
  • <!-- markdownlint-disable MD001 MD002 --> - Disable specific rules
  • <!-- markdownlint-enable MD001 MD002 --> - Re-enable specific rules
  • <!-- markdownlint-disable-line MD001 --> - Disable rules for current line
  • <!-- markdownlint-disable-next-line MD001 --> - Disable rules for next line
  • <!-- markdownlint-capture --> - Capture current configuration state
  • <!-- markdownlint-restore --> - Restore captured configuration state
  • <!-- markdownlint-disable-file --> - Disable all rules for entire file
  • <!-- markdownlint-enable-file --> - Re-enable all rules for entire file
  • <!-- markdownlint-disable-file MD001 MD002 --> - Disable specific rules for entire file
  • <!-- markdownlint-enable-file MD001 MD002 --> - Re-enable specific rules for entire file
  • <!-- markdownlint-configure-file { "MD013": { "line_length": 120 } } --> - Configure rules for entire file
  • <!-- prettier-ignore --> - Disable all rules for next line (compatibility with prettier)

Also supports rumdl-specific syntax with same semantics.

Structs§

InlineConfig
InlineConfigWarning
Warning about unknown rules in inline config comments

Functions§

is_capture_comment
Check if line contains a capture comment
is_restore_comment
Check if line contains a restore comment
parse_configure_file_comment
Parse a configure-file comment and return the JSON configuration
parse_disable_comment
Parse a disable comment and return the list of rules (empty vec means all rules)
parse_disable_file_comment
Parse a disable-file comment and return the list of rules (empty vec means all rules)
parse_disable_line_comment
Parse a disable-line comment
parse_disable_next_line_comment
Parse a disable-next-line comment
parse_enable_comment
Parse an enable comment and return the list of rules (empty vec means all rules)
parse_enable_file_comment
Parse an enable-file comment and return the list of rules (empty vec means all rules)
validate_inline_config_rules
Validate all inline config comments in content and return warnings for unknown rules.