You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following up from this discussion on Discuss: I'd like to have a way to avoid outputting style formatting in some circumstances (e.g. it seems Utop doesn't like styles when using `#install_printer#).
Although it would be less efficient, I tend to think the separation between document building and document printing speaks for providing a conditional printing function, akin to CCFormat.fprintf_dyn_color. What do you think?
Regarding how to implement this, I'm not sure to understand exactly how printing works in Containers_pp but it seems that the idea would be to ignore the color/styles extension when in a Wrap constructor when printing...?
The text was updated successfully, but these errors were encountered:
It's a bit tricky as things are right now, because extensions are responsible for their own printing. So, the color extension is the only thing aware of how colors are printed. I'm not sure how to transmit the information between the call to Containers_pp.pp out doc and the internal calls to Term_color's extension pre and post callbacks (bottom of containers_pp.ml).
Maybe a simple option would be to have an optional disabled_ext:string list -> … parameter to the printing functions. This doesn't break existing code (optional) but it'd modify the printers in Pretty to just skip the Wrap constructor when the extension's name is in the disabled list. (We would only print the inner document as is). What do you think?
Following up from this discussion on Discuss: I'd like to have a way to avoid outputting style formatting in some circumstances (e.g. it seems Utop doesn't like styles when using `#install_printer#).
Although it would be less efficient, I tend to think the separation between document building and document printing speaks for providing a conditional printing function, akin to
CCFormat.fprintf_dyn_color
. What do you think?Regarding how to implement this, I'm not sure to understand exactly how printing works in Containers_pp but it seems that the idea would be to ignore the color/styles extension when in a
Wrap
constructor when printing...?The text was updated successfully, but these errors were encountered: