Documentation

TermColor.Text

TermColor.Text: styled text and spans #

Text is a sequence of styled segments. The representation is deliberately small and transparent: append preserves order, and rendering is a pure fold over the segments.

One piece of text with one style overlay.

  • text : String

    Visible text in the segment.

  • style : Style

    Style applied to the segment.

Instances For
    Equations
    Instances For
      def TermColor.instDecidableEqSegment.decEq (x✝ x✝¹ : Segment) :
      Decidable (x✝ = x✝¹)
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          structure TermColor.Text :

          Text with styles attached to segments.

          Instances For
            Equations
            Instances For
              def TermColor.instDecidableEqText.decEq (x✝ x✝¹ : Text) :
              Decidable (x✝ = x✝¹)
              Equations
              Instances For
                @[instance_reducible]
                Equations
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  An empty text value.

                  Equations
                  Instances For

                    Unstyled text.

                    Equations
                    Instances For
                      def TermColor.Text.styled (text : String) (style : Style) :

                      Text with one style overlay.

                      Equations
                      Instances For
                        def TermColor.Text.append (left right : Text) :

                        Append two text values without changing their styles.

                        Equations
                        Instances For

                          Concatenate text values in order.

                          Equations
                          Instances For
                            def TermColor.Text.perChar (text : String) (style : NatNatStyle) :

                            Style every character of a string from its index and the total character count.

                            Equations
                            Instances For

                              Sweep the hue wheel across the characters of a string.

                              Equations
                              Instances For

                                Remove all ANSI styling while preserving the visible text.

                                Equations
                                Instances For

                                  Render one segment for a terminal target.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[simp]

                                    Plain targets preserve text and suppress both styles and hyperlinks.

                                    Render styled text, optionally emitting OSC-8 hyperlinks for linked segments.

                                    Equations
                                    Instances For