linkaudit package#
Submodules#
linkaudit.html_result module#
License GPL3
2024-2025 Created by Maikel Mardjan - https://nocomplexity.com/
Function to create a HTML result file of a linkaudit run
linkaudit.linkaudit module#
License GPL3
2024-2025 Created by Maikel Mardjan - https://nocomplexity.com/
Simple Link checker for JupyterBook markdown files. Simplifies maintenance for dead URLs in JupyterBook projects.
- async linkaudit.linkaudit.async_checkurl(url)[source]#
The async version Checks the status of a given URL and reports HTTP status codes or DNS errors.
- Parameters:
url (str) – The URL to check.
- Returns:
A tuple containing the URL and either the status code or an error message.
- Return type:
tuple
- linkaudit.linkaudit.check_links_in_markdown_file(file_path)[source]#
Checks all URLs in a markdown file
- linkaudit.linkaudit.check_md_files(bookdirectory, result_output='H')[source]#
Print txt tables of URLs checks of JB Book :param bookdirectory: The path to the directory containing Markdown files to analyze. :type bookdirectory: str :param result_output: Output format, “H” for HTML (default) or “T” for TXT.
Overridden by user input during execution.
- Returns:
Outputs either “linkaudit_result.html” or “linkaudit_result.md” based on user choice.
- Return type:
None
- linkaudit.linkaudit.display_version()[source]#
Prints the module version. Use [-v] [–v] [-version] or [–version].
- async linkaudit.linkaudit.process_multiple_urlchecks(urls)[source]#
Process multiple URLs asynchronously.
- linkaudit.linkaudit.show_all_links(bookdirectory)[source]#
Shows all URLs from MyST Markdown files in a directory and generates an HTML report.
- Parameters:
bookdirectory (str) – The path to the directory containing Markdown files to analyze.
- Returns:
Outputs an HTML file named “linkaudit_result.html” with the report.
- Return type:
None
linkaudit.markdownhelpers module#
License GPL3 (C) 2024-2025 Created by Maikel Mardjan - https://nocomplexity.com/
Help functions for dealing with markdown files, especially MyST.
- linkaudit.markdownhelpers.collect_markdown_files(directory)[source]#
Collects all Markdown files (.md) from a directory, including subdirectories, while skipping directories named ‘_build’, ‘_static’, and any directories starting with a dot (e.g., ‘.git’, ‘.env’).
- Parameters:
directory (str) – The path to the directory to search.
- Returns:
A list of paths to Markdown files.
- Return type:
list
- linkaudit.markdownhelpers.create_markdown_table(data)[source]#
Creates a markdown table from a list of dictionaries.
- Parameters:
data (list of dicts) – A list of dictionaries with ‘line_number’, ‘url’, and ‘status’ keys.
- Returns:
A markdown table string.
- Return type:
str
linkaudit.nocxhelpers module#
License GPL3
2024-2025 Created by Maikel Mardjan - https://nocomplexity.com/
Generic helper function(s).
- linkaudit.nocxhelpers.printProgressBar(iteration, total, prefix='', suffix='', decimals=1, length=100, fill='█', printEnd='\r')[source]#
Call in a loop to create terminal progress bar @params:
iteration - Required : current iteration (Int) total - Required : total iterations (Int) prefix - Optional : prefix string (Str) suffix - Optional : suffix string (Str) decimals - Optional : positive number of decimals in percent complete (Int) length - Optional : character length of bar (Int) fill - Optional : bar fill character (Str) printEnd - Optional : end character (e.g. “
“, ” “) (Str)