-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rich: io: refactoring HTML redirection streams onto dtsh.rich.html
When appending a captured command output to an existing HTML file, we asked the rich library Console.export_html() API to generate inline CSS styles rather than: - CSS class definitions in a <style> element - which the <span>s making the actual output will later point to using class identifiers This was handy: we didn't have to deal with "merging" existing classes and new HTML elements, both 1-indexed and overlapping. Unfortunately, the HTML generated by the rich library will render linked texts (e.g. a compatible string linked to a YAML binding file) with the Web browser's default style for unvisited links (typically blue), instead of the expected style (e.g. the one consistently used for compatible strings). This can produce ugly/confusing outputs [1]. We submitted a patch to the upstream rich library project [2]. This commit relies on dtsh.rich.html to decouple DTSh command output redirection to HTML files from the inline styles generated by the rich library. We may keep this approach even if the initial issue is fixed upstream. [1] #9 [2] Textualize/rich#3580
- Loading branch information
Showing
1 changed file
with
28 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters