CLASS ValidateLinksCommand

Validates internal and external links in generated HTML content.

Fields

Properties

DefaultRetryCount

(int) = 3: Number of times to retry failed external link validations

DefaultRetryInterval

(int) = 1000: Interval in milliseconds between retry attempts

DefaultTimeout

(int) = 10000: Timeout in milliseconds for external link validation requests

Public Methods

Parse

public async Task<ValidateLinksCommand> Parse()

Parses content and validates all links

Returns: Task<ValidateLinksCommand>

  • The current command instance

GenerateReport

public Task<int> GenerateReport()

Generates validation report and returns exit code

Returns: Task<int>

  • Exit code indicating success (0) or failure (1)
public static Task<LinkStatus> ValidateInternalLink(Uri linkStripped, Uri link, IDictionary<Uri, IOutput> outputReferences)

Validates if an internal link exists in output references

Parameters:

  • linkStripped (Uri): Link to validate
  • link (Uri)
  • outputReferences (IDictionary<Uri, IOutput>): Dictionary of output references

Returns: Task<LinkStatus>

  • True if link is valid, false otherwise
public async Task<LinkStatus> ValidateExternalLink(Uri link, Uri sourceFile, IHttpClientWrapper httpClient)

Validates if an external link is accessible

Parameters:

  • link (Uri): Link to validate
  • sourceFile (Uri): Source file containing the link
  • httpClient (IHttpClientWrapper): HTTP client for making requests

Returns: Task<LinkStatus>

  • True if link is valid, false otherwise