Main¶
markdown-checker — a markdown link validation reporting tool.
- class markdown_checker.Config(skip_domains=<factory>, skip_urls_containing=<factory>, tracking_domains=<factory>, timeout=20, retries=3, retry_on_429=True, fallback_retry_delay=30, output_mode='local')¶
Holds all runtime configuration for a check run.
- Parameters:
- class markdown_checker.MarkdownLinkBase(link, line_number, file_path, issue='', issue_level='error')¶
Base class for markdown links
- Parameters:
- has_locale()¶
Check if the link has a locale
- Returns:
True if the link has a locale, False otherwise
- Return type:
- class markdown_checker.MarkdownPath(link, line_number, file_path, issue='', issue_level='error')¶
Dataclass to store info about a path
- Parameters:
- property path_without_fragments: Path¶
Get the path without the fragment
- Returns:
The path without the fragment
- remove_fragments()¶
Remove the fragments from a path
- Returns:
The path without the fragment
- Return type:
- get_full_path()¶
Get the full path of the file by resolving the path without fragments
- Returns:
The full path of the file
- Return type:
- get_full_path_relative()¶
Get the full path of the file by resolving the path without fragments
- Returns:
The full path of the file
- Return type:
- class markdown_checker.MarkdownURL(link, line_number, file_path, issue='', issue_level='error')¶
Dataclass to store info about a url
- Parameters:
- property parsed_url: ParseResult¶
Parse the URL and return the result
- Returns:
ParseResult: The parsed URL
- check(timeout=20, retries=3, client=None, retry_on_429=True, fallback_retry_delay=30)¶
Check whether the URL is reachable and return a typed outcome.
- Args:
timeout (int): Timeout for the request in seconds. retries (int): Number of retries if the request fails. client (httpx2.Client | None): Optional shared client for connection pooling. retry_on_429 (bool): When True, honour Retry-After headers on 429 responses. fallback_retry_delay (int): Seconds to wait when a 429 carries no Retry-After header.
- Returns:
URLCheckResult with status one of:
alive,broken,rate_limited, ortransient_error.
- Parameters:
- Return type: