question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Misaligned box boundaries in SVG generated from a rich-click help dialogue

See original GitHub issue

I’m using the new save_svg method to write a SVG of a help dialogue generated with @ewelsrich-click. However, the characters of the right side of the box are misaligned.

HELP

Apparently these additional whitespaces are being caused my markup. For example, the DESTINATION in the dialogue is [u]DESTINATION[/u]. But this seems to be another issue, since it doesn’t happen when I keep the default Fira Code font.

Python 3.8.12
rich 12.4.1
macOS 12.3.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
apcamargocommented, May 16, 2022

@ewels Very dirty code:

def _get_rich_console() -> Console:
    console = Console(
        record=True, # <- I added this parameter
        theme=Theme(
            {
                "option": STYLE_OPTION,
                "switch": STYLE_SWITCH,
                "metavar": STYLE_METAVAR,
                "metavar_sep": STYLE_METAVAR_SEPARATOR,
                "usage": STYLE_USAGE,
            }
        ),
        highlighter=highlighter,
        color_system=COLOR_SYSTEM,
    )

…

    # Epilogue if we have it
    if obj.epilog:
        # Remove single linebreaks, replace double with single
        lines = obj.epilog.split("\n\n")
        epilogue = "\n".join([x.replace("\n", " ").strip() for x in lines])
        console.print(Padding(Align(highlighter(epilogue), width=MAX_WIDTH, pad=False), 1))

    # Footer text if we have it
    if FOOTER_TEXT:
        console.print(Padding(_make_rich_rext(FOOTER_TEXT, STYLE_FOOTER_TEXT), (1, 1, 0, 1)))

    from rich.terminal_theme import DIMMED_MONOKAI
    
    # Save the SVG within `rich_format_help`
    console.save_svg(
        "/Users/APCamargo-M55/Documents/genomad/help_dialog.svg",
        title="genomad",
        theme=DIMMED_MONOKAI,
        code_format=CONSOLE_SVG_FORMAT,
        )
0reactions
github-actions[bot]commented, Jun 10, 2022

Did I solve your problem?

Why not buy the devs a coffee to say thanks?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CmapTools Known Issues - IHMC
In all distributions of Linux, CmapTools presents a bug related to the size of menu separators that shows as no borders at all...
Read more >
Release notes for Semi-Annual Enterprise Channel
This fix unhides that data from the UI dialog box. Change impacts the conditional formatting or series selection dialog boxes on a 3...
Read more >
Known Bug List - Claris Community - FileMaker Pro
FMPro v.10 produces blank messages instead of normal error dialogue boxes if two people are using the software on the same computer.
Read more >
Bug listing with status RESOLVED with resolution UPSTREAM ...
Bug :6292 - "loadkeys broken, or kernel memory garbled!!! ... Bug:85202 - "inaccuracy in "make menuconfig" help dialog box" status:RESOLVED ...
Read more >
Objectives of the SVG Format - FLOSS Manuals (en)
In order to address this discontent and provide an open option for vector graphics, the W3C created the SVG file format, making a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found