You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature request] Add Console.export_markdown() to export recorded output as Markdown #4271
Console can already export its recorded output as plain text (export_text), HTML (export_html) and SVG (export_svg), but there is no way to export it as Markdown. Markdown output would be useful for pasting rendered CLI output into README files, documentation, notebooks and GitHub issues while keeping basic styling such as bold, italic and links.
Requires the console to be created with record=True, otherwise it raises ValueError (same pattern as the other export methods).
Converts recorded segments to Markdown: bold to **...**, italic to *...*, bold + italic to ***...***, strikethrough to ~~...~~, and links to [text](url).
Preserves line endings and leading/trailing spaces outside the markup.
With escape_special_chars=True, punctuation characters in the content are backslash-escaped.
Clears the record buffer when clear=True (the default), like export_text.
Implementation
I have a working implementation with tests on my fork, and I would be happy to open a pull request — I noticed PR creation is currently limited to collaborators, which is why I am opening this issue first.
Activity