Skip to main content

Module discovery

Module discovery 

Source
Expand description

Shared markdown file discovery semantics.

The CLI walker (file_processor::discovery in the binary crate) and the LSP workspace index scanner answer the same question: which files does rumdl process here? The pieces of that answer that must never diverge live in this module:

  • the markdown extension set and how it is matched,
  • how ignore-file handling (.gitignore, .markdownlintignore, hidden entries) is configured on a walker,
  • how exclude patterns from config are expanded and matched.

Callers still differ deliberately: the LSP skips .git/node_modules/ target outright as an editor-performance safety net, while the CLI walks whatever gitignore semantics allow.

Structs§

ExcludeMatchers
Compiled exclude patterns with directory-pattern expansion applied.
MarkdownWalkOptions
Ignore-handling options applied to a markdown discovery walk.

Constants§

MARKDOWN_EXTENSIONS
File extensions rumdl treats as markdown, lowercase.

Functions§

apply_markdown_walk_options
Apply the shared ignore-handling configuration to a walker.
expand_directory_pattern
Expands directory-style patterns to also match files within them. Pattern “dir/path” becomes [“dir/path”, “dir/path/**”] to match both the directory itself and all contents recursively.
has_markdown_extension
Whether path has a markdown extension.
is_markdown_extension
Whether ext is a markdown extension. Matches case-insensitively so conventional variants like Rmd (and shouting-case MD) qualify.
markdown_walk_builder
Build a walker over root configured with the shared options.
path_relative_to
Relativize path against base for exclude-pattern matching, canonicalizing both sides so symlinks (e.g. macOS /tmp) and Windows path-representation differences don’t defeat the prefix strip. Returns None when path is not under base.