package miaou-core
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6
doc/miaou_widgets_display/Miaou_widgets_display/Widgets/index.html
Module Miaou_widgets_display.WidgetsSource
Detect whether OSC 8 hyperlinks are likely supported. Returns false inside tmux/screen (which strip OSC sequences by default) unless the user has set MIAOU_TUI_HYPERLINKS=on to force them.
Wrap display in an OSC 8 hyperlink pointing to url. Terminal emulators that support OSC 8 render display as a clickable link. When running inside tmux or screen (which strip OSC sequences), display is returned as-is. Override with MIAOU_TUI_HYPERLINKS=on.
module Style = Miaou_style.Stylemodule Style_context = Miaou_style.Style_contextApply a Style.t to a string, producing ANSI-formatted output
Primary content - main UI elements, important text
Secondary content - less prominent elements
Accent - highlights, links, interactive elements
Error state - validation errors, failures, critical issues
Warning state - cautions, potential issues
Success state - confirmations, completed actions
Info state - neutral information, tips
Normal text - default readable content
Muted text - less important, secondary information
Emphasized text - bold/highlighted content
Border styling - for widget frames and separators
Selection highlight - for selected items in lists/tables
Background - primary background color
Alternate background - for contrast (e.g., alternate rows)
Apply the current contextual style (based on widget name, focus, position). Use this when rendering content that should respect CSS-like selector rules from the theme. The style is determined by Style_context.current_style().
Apply themed foreground color to text that has no foreground set. This ensures all text is visible regardless of terminal defaults. Essential for light themes where default foreground may be invisible.
The algorithm:
- Split text into segments by ANSI escape sequences
- For each plain text segment not preceded by a foreground color code, wrap it with the theme's text foreground color
- Preserve all existing ANSI codes
Apply contextual background to full line width without overriding text.
Apply theme background to entire content, padding lines to full width. This ensures the terminal background is filled with the theme's color.
Get the resolved widget style for the current context. Returns a Theme.widget_style record with style, border_style, etc.
val render_frame :
title:string ->
?header:??? ->
?cols:??? ->
body:string ->
footer:string ->
unit ->
stringval render_left_border_box :
?border_color:??? ->
?bg_color:??? ->
cols:int ->
string ->
stringRender a box with only a left border and colored background. Useful for displaying context sections, file content, or quoted messages.
val overlay :
base:string ->
content:string ->
top:int ->
left:int ->
canvas_h:int ->
canvas_w:int ->
stringval center_modal :
cols:int option ->
?rows:??? ->
?title:??? ->
?padding:??? ->
?max_width:??? ->
?max_height:??? ->
?dim_background:??? ->
?left:??? ->
content:string ->
base:string ->
unit ->
string