Skip to content

🖨️ A more flexible API to specify output target #150

@kentookura

Description

@kentookura

I am experimenting with Nottui and would like to display diagnostics in my application. I am aware that terminal rendering used to be handled with notty.

From looking at the code in Tty, maybe this can be achieved by just exposing function that is a bit more flexible than display?
I'd just like to pass my own formatter here:

DiagnosticRenderer.render_diagnostic ~param fmt d;

What I tried so far:

My best guess is to write a function display : Message.t Diagnostic.t -> ui, where ui is a wrapper around the image type of Notty. I could use the optional output argument of display, but it is not obvious to me how to hook the out_channel into my application. The toplevel of the UI is started by Ui_loop.run... which takes a Notty_unix.Term.t... into which I can pass an out_channel... This seems messy.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions