cosapp.tools.views.baseRenderer

Classes

BaseRenderer(system[, embeddable])

Base class to export a system as HTML.

class cosapp.tools.views.baseRenderer.BaseRenderer(system: System, embeddable=False)[source]

Bases: object

Base class to export a system as HTML.

Parameters:
  • system (System) – System to export

  • embeddable (bool, optional) – Is the HTML to be embedded in an existing page? Default: False

dump(fstream: RawIOBase) None[source]

Dump HTML content into writable fstream

abstract get_data(**kwarg) dict[source]

Convert self.system into a dictionary used to build the HTML page.

Returns:

Dictionary containing elements to create an HTML page.

Return type:

dict

classmethod get_globals() dict[source]

Returns a dict containing class-wide environment and HTML data

abstract html_content() str[source]

Returns HTML content of renderer’s system as a character string.

abstract classmethod html_resources() dict[str, str][source]

Return the necessary resources to render a Jinja template.

classmethod html_tags() dict[str, str][source]
abstract classmethod html_template() Template[source]

Return the Jinja template used to create an HTML file.

to_file(filename: str) None[source]

Dump HTML content into text file filename