Skip to content

html

html

HTML document based report renderer.

HTMLRenderer

Bases: Renderer

Renderer implementation outputting HTML files content.

Source code in cssfinder/reports/html.py
class HTMLRenderer(Renderer):
    """Renderer implementation outputting HTML files content."""

    def __init__(self, props: SlopeProperties, plots: list[Plot], task: Task) -> None:
        super().__init__(props, plots, task)
        self.env = get_cssfinder_jinja2_environment()

    def render(self) -> Report:
        """Generate report content."""
        template = self.env.get_template("report.html.jinja2")
        return Report(
            template.render(ctx=self.ctx).encode("utf-8"),
            ReportType.HTML,
            self.ctx.task.task_output_directory / "report.html",
        )

render

render() -> Report

Generate report content.

Source code in cssfinder/reports/html.py
def render(self) -> Report:
    """Generate report content."""
    template = self.env.get_template("report.html.jinja2")
    return Report(
        template.render(ctx=self.ctx).encode("utf-8"),
        ReportType.HTML,
        self.ctx.task.task_output_directory / "report.html",
    )