github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/gen/user-guide/ansi_doc.yaml (about)

     1  - DocumentID: ansi
     2    Title: >-
     3      ANSI Constants
     4    CategoryID: user-guide
     5    Summary: >-
     6      Infixed constants that return ANSI escape sequences
     7    Description: |-
     8      ## Description
     9  
    10      ANSI Constants is a Murex convention of passing ANSI escape sequences into
    11      strings. It uses the `{}` notation with the constant name placed in between two
    12      curly braces. eg `{GREEN}`. 
    13  
    14      ## Constants
    15  
    16      Rather than duplicate the constants from source, and risk the documentation and
    17      implementation drifting, this document will embed the source directly below.
    18  
    19      ```go
    20      {{ include "utils/ansi/consts.go" }}
    21      ```
    22  
    23      ### How To Read The Code Above
    24  
    25      Each line will look something a little like
    26      
    27      ```
    28      "GREEN":   {27, 91, 51, 50, 109},
    29      ```
    30      
    31      The part within quotes is the constant name, and the part that follows is the
    32      sequence of bytes that are infixed.
    33  
    34      So the example above will replace `{GREEN}` from within a string with the
    35      byte values of 27, 91, 51, 50 and 109 (in that order).
    36  
    37      ## Unsupported Constants
    38  
    39      If a constant does not exist in the above code, then the infix string is left
    40      unedited.
    41  
    42      ```
    43      # Green spelt correctly
    44      » out "{GREEN}PASSED{RESET}"
    45      PASSED
    46      
    47      # Green spelt incorrectly (ie so that it doesn't exist as a valid constant)
    48      » out "{GREEEEN}PASSED{RESET}"
    49      {GREEEEN}PASSED
    50      ```
    51  
    52      ## Enabling / Disabling ANSI Escape Sequences
    53  
    54      These sequences are enabled by default. To disable run the following:
    55  
    56      ```
    57      » config set shell color false
    58      ```
    59  
    60      You will need to add this to your Murex profile, `~/.murex_profile` to make
    61      it persistent.
    62    Synonyms:
    63    Related:
    64    - brace-quote-func
    65    - brace-quote
    66    - out
    67    - tout
    68    - err
    69    - profile