Repository: Textualize/rich
File: rich/console.py (Python)

Code before:
            theme (TerminalTheme, optional): TerminalTheme object containing console colors.
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            code_format (str, optional): Format string to render HTML. In addition to '{foreground}',
                '{background}', and '{code}', should contain '{stylesheet}' if inline_styles is ``False``.
            inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files
                larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag.
                Defaults to False.

        """
        html = self.export_html(
            theme=theme,
            clear=clear,
            code_format=code_format,
            inline_styles=inline_styles,
        )
        with open(path, "wt", encoding="utf-8") as write_file:
            write_file.write(html)

    def export_svg(
        self,
        *,
        title: str = "Rich",
        theme: Optional[TerminalTheme] = None,
        clear: bool = True,
        code_format: str = CONSOLE_SVG_FORMAT,
        font_family: str = "Rich Fira Code",
        wrapper_id: str = "rich-svg-wrapper",
    ) -> str:
        """Generate an SVG string from the console contents (requires record=True in Console constructor)

        Args:
            title (str): The title of the tab in the output image
            theme (TerminalTheme, optional): The ``TerminalTheme`` object to use to style the terminal
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``
            code_format (str): Format string used to generate the SVG. Rich will inject a number of variables
                into the string in order to form the final SVG output. The default template used and the variables
                injected by Rich can be found by inspecting the ``console.CONSOLE_SVG_FORMAT`` variable.
            font_family (str): The name of the CSS font family used in the SVG. Defaults to ``"Rich Fira Code"``,
                in order to avoid contaminating the other fonts when the SVG is embedded into an HTML page.
            wrapper_id (str): The ID of the SVG's root element. Defaults to ``"rich-svg-wrapper"``,
                in order to avoid contaminating the other CSS selectors when the SVG is embedded into an HTML page.

        Returns:
            str: The string representation of the SVG. That is, the ``code_format`` template with content injected.
        """
        assert (
            self.record
        ), "To export console contents set record=True in the constructor or instance"

        _theme = theme or SVG_EXPORT_THEME


Review comment (suggestion):
I don't think there is much benefit in exposing these. Both `font_family` and `wrapper_id` could be chose by us to stand a reasonable change of being unique.

Defaults are good, suggest just removing them from the argument list.

Code after:
        inline_styles: bool = False,
    ) -> None:
        """Generate HTML from console contents and write to a file (requires record=True argument in constructor).

        Args:
            path (str): Path to write html file.
            theme (TerminalTheme, optional): TerminalTheme object containing console colors.
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
            code_format (str, optional): Format string to render HTML. In addition to '{foreground}',
                '{background}', and '{code}', should contain '{stylesheet}' if inline_styles is ``False``.
            inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files
                larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag.
                Defaults to False.

        """
        html = self.export_html(
            theme=theme,
            clear=clear,
            code_format=code_format,
            inline_styles=inline_styles,
        )
        with open(path, "wt", encoding="utf-8") as write_file:
            write_file.write(html)

    def export_svg(
        self,
        *,
        title: str = "Rich",
        theme: Optional[TerminalTheme] = None,
        clear: bool = True,
        code_format: str = CONSOLE_SVG_FORMAT,
    ) -> str:
        """Generate an SVG string from the console contents (requires record=True in Console constructor)

        Args:
            title (str): The title of the tab in the output image
            theme (TerminalTheme, optional): The ``TerminalTheme`` object to use to style the terminal
            clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``
            code_format (str): Format string used to generate the SVG. Rich will inject a number of variables
                into the string in order to form the final SVG output. The default template used and the variables
                injected by Rich can be found by inspecting the ``console.CONSOLE_SVG_FORMAT`` variable.

        Returns:
            str: The string representation of the SVG. That is, the ``code_format`` template with content injected.
        """
        assert (
            self.record
        ), "To export console contents set record=True in the constructor or instance"

        _theme = theme or SVG_EXPORT_THEME