Checks

Base

class markdown_checker.checks.base.BaseCheck

Bases: Generic[TLink], ABC

Abstract base class for all link checks.

name: str
abstractmethod run(links, config=None)

Run the check against the extracted links.

Args:

links (MarkdownLinks): Extracted URLs and paths from a file. config: Runtime configuration for the check run.

Returns:

List of links that failed the check, each with an .issue set.

Parameters:
Return type:

list[TLink]

Broken Paths

class markdown_checker.checks.broken_paths.BrokenPathsCheck

Bases: BaseCheck[MarkdownPath]

Check for relative paths in markdown files that do not exist on disk.

name: str = 'check_broken_paths'
run(links, config=None)

Run the check against the extracted links.

Args:

links (MarkdownLinks): Extracted URLs and paths from a file. config: Runtime configuration for the check run.

Returns:

List of links that failed the check, each with an .issue set.

Parameters:
Return type:

list[MarkdownPath]

Broken URLs

class markdown_checker.checks.broken_urls.BrokenURLsCheck

Bases: BaseCheck[MarkdownURL]

Check for URLs in markdown files that return non-2xx responses.

name: str = 'check_broken_urls'
run(links, config=None)

Run the check against the extracted links.

Args:

links (MarkdownLinks): Extracted URLs and paths from a file. config: Runtime configuration for the check run.

Returns:

List of links that failed the check, each with an .issue set.

Parameters:
Return type:

list[MarkdownURL]

Locale

class markdown_checker.checks.locale.URLsLocaleCheck

Bases: BaseCheck[MarkdownURL]

Check that URLs do not contain a country/language locale segment.

name: str = 'check_urls_locale'
run(links, config=None)

Run the check against the extracted links.

Args:

links (MarkdownLinks): Extracted URLs and paths from a file. config: Runtime configuration for the check run.

Returns:

List of links that failed the check, each with an .issue set.

Parameters:
Return type:

list[MarkdownURL]

Tracking

class markdown_checker.checks.tracking.URLsTrackingCheck

Bases: BaseCheck[MarkdownURL]

Check that URLs on configured tracking domains include a tracking ID.

name: str = 'check_urls_tracking'
run(links, config=None)

Run the check against the extracted links.

Args:

links (MarkdownLinks): Extracted URLs and paths from a file. config: Runtime configuration for the check run.

Returns:

List of links that failed the check, each with an .issue set.

Parameters:
Return type:

list[MarkdownURL]

class markdown_checker.checks.tracking.PathsTrackingCheck

Bases: BaseCheck[MarkdownPath]

Check that relative paths include a tracking ID.

name: str = 'check_paths_tracking'
run(links, config=None)

Run the check against the extracted links.

Args:

links (MarkdownLinks): Extracted URLs and paths from a file. config: Runtime configuration for the check run.

Returns:

List of links that failed the check, each with an .issue set.

Parameters:
Return type:

list[MarkdownPath]