package miaou-core

  1. Overview
  2. Docs
Miaou core/widgets (no drivers, no SDL)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.5.2.tar.gz
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6

doc/miaou_widgets_display/Miaou_widgets_display/Widgets/index.html

Module Miaou_widgets_display.WidgetsSource

Sourceval ansi : string -> string -> string
Sourceval osc8_supported : bool lazy_t

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.

Sourceval bold : string -> string
Sourceval dim : string -> string
Sourceval fg : int -> string -> string
Sourceval bg : int -> string -> string
Sourceval green : string -> string
Sourceval red : string -> string
Sourceval yellow : string -> string
Sourceval blue : string -> string
Sourceval magenta : string -> string
Sourceval cyan : string -> string
module Style = Miaou_style.Style
module Style_context = Miaou_style.Style_context
Sourceval styled : Miaou_style.Style.t -> string -> string

Apply a Style.t to a string, producing ANSI-formatted output

Sourceval themed_primary : string -> string

Primary content - main UI elements, important text

Sourceval themed_secondary : string -> string

Secondary content - less prominent elements

Sourceval themed_accent : string -> string

Accent - highlights, links, interactive elements

Sourceval themed_error : string -> string

Error state - validation errors, failures, critical issues

Sourceval themed_warning : string -> string

Warning state - cautions, potential issues

Sourceval themed_success : string -> string

Success state - confirmations, completed actions

Sourceval themed_info : string -> string

Info state - neutral information, tips

Sourceval themed_text : string -> string

Normal text - default readable content

Sourceval themed_muted : string -> string

Muted text - less important, secondary information

Sourceval themed_emphasis : string -> string

Emphasized text - bold/highlighted content

Sourceval themed_border : ?focus:??? -> string -> string

Border styling - for widget frames and separators

Sourceval themed_selection : string -> string

Selection highlight - for selected items in lists/tables

Sourceval themed_background : string -> string

Background - primary background color

Sourceval themed_background_alt : string -> string

Alternate background - for contrast (e.g., alternate rows)

Sourceval themed_contextual : string -> string

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().

Sourceval has_pixel_proto : string -> bool
Sourceval apply_bg_fill : bg:int -> string -> string
Sourceval apply_themed_foreground : string -> string

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
Sourceval themed_contextual_fill : string -> string

Apply contextual background to full line width without overriding text.

Sourceval apply_themed_background : rows:int -> cols:int -> string -> string

Apply theme background to entire content, padding lines to full width. This ensures the terminal background is filled with the theme's color.

Sourceval current_widget_style : unit -> Miaou_style.Theme.widget_style

Get the resolved widget style for the current context. Returns a Theme.widget_style record with style, border_style, etc.

Sourceval color_border : string -> string
Sourceval title_highlight : string -> string
Sourceval is_utf8_lead : char -> bool
Sourceval is_esc_start : string -> int -> bool
Sourceval skip_ansi_until_m : string -> int -> int
Sourceval visible_chars_count : string -> int
Sourceval visible_byte_index_of_pos : string -> int -> int
Sourceval has_trailing_reset : string -> bool
Sourceval insert_before_reset : string -> string -> string
Sourceval pad_to_width : string -> int -> char -> string
Sourceval use_ascii_borders : bool lazy_t
Sourceval glyph_corner_tl : string
Sourceval glyph_corner_tr : string
Sourceval glyph_corner_bl : string
Sourceval glyph_corner_br : string
Sourceval glyph_hline : string
Sourceval glyph_vline : string
Sourceval glyph_top_sep : string
Sourceval glyph_mid_left : string
Sourceval glyph_mid_sep : string
Sourceval glyph_mid_right : string
Sourceval glyph_bottom_sep : string
Sourcetype backend = [
  1. | `Terminal
  2. | `Sdl
]
Sourceval current_backend : backend Stdlib.ref
Sourceval set_backend : backend -> unit
Sourceval get_backend : unit -> backend
Sourceval prefer_ascii : ?backend:??? -> unit -> bool
Sourceval glyph_up : ?backend:??? -> unit -> string
Sourceval glyph_down : ?backend:??? -> unit -> string
Sourceval glyph_bullet : ?backend:??? -> unit -> string
Sourceval hr : width:int -> ?char:??? -> unit -> string
Sourceval pad_visible : string -> int -> string
Sourceval wrap_text : width:int -> string -> string list
Sourceval json_pretty : string -> string
Sourceval json_pretty_ansi : string -> string
Sourceval highlight_matches : is_regex:bool -> query:string option -> string -> string
Sourceval titleize : string -> string
Sourceval render_frame : title:string -> ?header:??? -> ?cols:??? -> body:string -> footer:string -> unit -> string
Sourceval color_for_status : string -> string -> string
Sourceval sel_marker : 'a -> 'a -> string
Sourceval chip_ok : string -> string
Sourceval chip_warn : string -> string
Sourceval chip_err : string -> string
Sourceval pad_to_cols_line : cols:int -> string -> string
Sourceval warning_banner : cols:int -> string -> string
Sourceval ok_banner : cols:int -> string -> string
Sourceval info_banner : cols:int -> string -> string
Sourceval error_banner : cols:int -> string -> string
Sourceval palette : unit -> Miaou_interfaces.Palette.t
Sourceval fg_primary : string -> string
Sourceval fg_secondary : string -> string
Sourceval fg_muted : string -> string
Sourceval bg_selection : string -> string
Sourceval selection_fg : string -> string
Sourceval render_left_border_box : ?border_color:??? -> ?bg_color:??? -> cols:int -> string -> string

Render a box with only a left border and colored background. Useful for displaying context sections, file content, or quoted messages.

  • parameter border_color

    ANSI 256 color for the left border (default: 75, blue)

  • parameter bg_color

    ANSI 256 color for background (default: 236, dark gray)

  • parameter cols

    Total width of the box

  • parameter content

    The text content (may be multiline)

Sourceval overlay : base:string -> content:string -> top:int -> left:int -> canvas_h:int -> canvas_w:int -> string
Sourceval center_modal : cols:int option -> ?rows:??? -> ?title:??? -> ?padding:??? -> ?max_width:??? -> ?max_height:??? -> ?dim_background:??? -> ?left:??? -> content:string -> base:string -> unit -> string