Skip to content

[622] py-script should only render to the page through the display function #635

@fpliger

Description

@fpliger

Checklist

  • I added a descriptive title
  • I searched for other feature requests and couldn't find a duplicate (including also the type-feature tag)
  • I confirmed that it's not related to another project area (see the above section)

What is the idea?

In order to disambiguate debugging output and rendering to the page, we want to add a new display function that can be called explicitly whenever the user wants to render things on the page. See more details at #622

Why is this needed

Se #622

What should happen?

We will introduce a new method display that can be used to display objects and other things on the page.

Here's the proposed method:

def display(*objects, parent=None):
    """Display `objects` on parent. 

All non-keyword arguments are converted using the global renderer mapper or using the object `__repr__` if a renderer for that object is not present. 

If `parent` is None, the parent object set at the global `py-script` tag level will be used. 
    """

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogissue has been triaged but has not been earmarked for any upcoming releaseneeds-triageIssue needs triagetype: featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions