How to use the rich.markdown.Markdown function in rich

To help you get started, we’ve selected a few rich examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github intel / cve-bin-tool / cve_bin_tool / OutputEngine.py View on Github external
# Add CVEData to the table
        for cve_data in self.formatted_output:
            color = colors[cve_data["severity"]]
            table.add_row(
                f'[{color}]{cve_data["vendor"]} [/{color}]',
                f'[{color}]{cve_data["product"]} [/{color}]',
                f'[{color}]{cve_data["version"]} [/{color}]',
                f'[{color}]{cve_data["cve_number"]} [/{color}]',
                f'[{color}]{cve_data["severity"]} [/{color}]',
            )

        now = datetime.now().strftime("%Y-%m-%d  %H:%M:%S")

        console.print(
            Markdown(
                textwrap.dedent(
                    f"""
                    # CVE BINARY TOOL
                    - cve-bin-tool Report Generated: {now}
                    """
                )
            )
        )
        # Print the table to the console
        console.print(table)