markdown_formatter
appimage_updater.ui.output.markdown_formatter
¶
Markdown output formatter implementation with GitHub-compatible syntax.
LATEX_SPECIAL_CHARS = {'&': '\\&', '%': '\\%', '$': '\\$', '#': '\\#', '_': '\\_', '{': '\\{', '}': '\\}', '~': '\\textasciitilde{}', '^': '\\textasciicircum{}', '\\': '\\textbackslash{}'}
module-attribute
¶
MarkdownOutputFormatter(**_kwargs)
¶
Markdown output formatter for GitHub-compatible markdown output.
This formatter provides markdown output with GitHub-compatible syntax, including support for tables, colored text using \(\(\color{color-name}{}\)\), and proper markdown formatting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**_kwargs
|
Any
|
Additional arguments (ignored for compatibility) |
{}
|
Source code in src/appimage_updater/ui/output/markdown_formatter.py
end_section()
¶
finalize()
¶
Finalize markdown output and return complete content.
Returns:
Type | Description |
---|---|
str | None
|
Complete markdown document as string |
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_application_details(app_details)
¶
Display application details in structured format (matching Rich panels).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app_details
|
dict[str, Any]
|
Dictionary containing application details |
required |
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_application_list(applications)
¶
Display application list as markdown table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
applications
|
list[dict[str, Any]]
|
List of application dictionaries |
required |
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_check_results(results)
¶
Display check results as markdown table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results
|
list[dict[str, Any]]
|
List of check result dictionaries |
required |
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_config_settings(settings)
¶
Display configuration settings as markdown.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings
|
dict[str, Any]
|
Dictionary of configuration settings |
required |
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_error(message)
¶
Display error message with red color.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Error message to display |
required |
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_info(message)
¶
Display info message with cyan color (matching Rich formatter).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Info message to display |
required |
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_message(message, **kwargs)
¶
Write a message as markdown text.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
The message to write |
required |
**kwargs
|
Any
|
Additional options (color, bold, etc.) |
{}
|
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_progress(current, total, description='')
¶
Display progress information as markdown.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
current
|
int
|
Current progress value |
required |
total
|
int
|
Total progress value |
required |
description
|
str
|
Optional progress description |
''
|
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_success(message)
¶
Display success message with green color.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Success message to display |
required |
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_table(data, title='', headers=None)
¶
Display tabular data as markdown table with colored columns.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
list[dict[str, Any]]
|
List of dictionaries representing table rows |
required |
title
|
str
|
Optional table title |
''
|
headers
|
list[str] | None
|
Optional custom headers |
None
|
Source code in src/appimage_updater/ui/output/markdown_formatter.py
print_warning(message)
¶
Display warning message with yellow color (matching Rich formatter).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
Warning message to display |
required |
Source code in src/appimage_updater/ui/output/markdown_formatter.py
start_section(title)
¶
Start a new output section with markdown heading.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
str
|
Section title |
required |