clx-browser

[ACTIVE] a smol browser based off of circumflex
git clone git://git.figbert.com/clx-browser.git
Log | Files | Refs | README | LICENSE

style.go (5124B)


      1 package main
      2 
      3 import (
      4 	"github.com/charmbracelet/glamour/ansi"
      5 )
      6 
      7 var CLXStyleConfig = ansi.StyleConfig{
      8 	Document: ansi.StyleBlock{
      9 		StylePrimitive: ansi.StylePrimitive{
     10 			BlockPrefix: "\n",
     11 			BlockSuffix: "\n",
     12 			Color:       stringPtr("252"),
     13 		},
     14 		Margin: uintPtr(2),
     15 	},
     16 	BlockQuote: ansi.StyleBlock{
     17 		StylePrimitive: ansi.StylePrimitive{Color: stringPtr("244")},
     18 		Indent:         uintPtr(1),
     19 		IndentToken:    stringPtr("│ "),
     20 	},
     21 	List: ansi.StyleList{
     22 		LevelIndent: 2,
     23 	},
     24 	Heading: ansi.StyleBlock{
     25 		StylePrimitive: ansi.StylePrimitive{
     26 			BlockSuffix: "\n",
     27 			Color:       stringPtr("39"),
     28 			Bold:        boolPtr(true),
     29 		},
     30 	},
     31 	H1: ansi.StyleBlock{
     32 		StylePrimitive: ansi.StylePrimitive{
     33 			Prefix:          " ",
     34 			Suffix:          " ",
     35 			Color:           stringPtr("228"),
     36 			BackgroundColor: stringPtr("63"),
     37 			Bold:            boolPtr(true),
     38 		},
     39 	},
     40 	H2: ansi.StyleBlock{
     41 		StylePrimitive: ansi.StylePrimitive{
     42 			Color: stringPtr("252"),
     43 		},
     44 	},
     45 	H3: ansi.StyleBlock{
     46 		StylePrimitive: ansi.StylePrimitive{
     47 			Underline: boolPtr(true),
     48 		},
     49 	},
     50 	H4: ansi.StyleBlock{
     51 		StylePrimitive: ansi.StylePrimitive{
     52 			Color:     stringPtr("220"),
     53 			Underline: boolPtr(true),
     54 		},
     55 	},
     56 	H5: ansi.StyleBlock{
     57 		StylePrimitive: ansi.StylePrimitive{
     58 			Prefix: "##### ",
     59 		},
     60 	},
     61 	H6: ansi.StyleBlock{
     62 		StylePrimitive: ansi.StylePrimitive{
     63 			Prefix: "###### ",
     64 			Color:  stringPtr("35"),
     65 			Bold:   boolPtr(false),
     66 		},
     67 	},
     68 	Strikethrough: ansi.StylePrimitive{
     69 		CrossedOut: boolPtr(true),
     70 	},
     71 	Emph: ansi.StylePrimitive{
     72 		Italic: boolPtr(true),
     73 	},
     74 	Strong: ansi.StylePrimitive{
     75 		Bold: boolPtr(true),
     76 	},
     77 	HorizontalRule: ansi.StylePrimitive{
     78 		Color:  stringPtr("240"),
     79 		Format: "\n--------\n",
     80 	},
     81 	Item: ansi.StylePrimitive{
     82 		BlockPrefix: "• ",
     83 	},
     84 	Enumeration: ansi.StylePrimitive{
     85 		BlockPrefix: ". ",
     86 	},
     87 	Task: ansi.StyleTask{
     88 		StylePrimitive: ansi.StylePrimitive{},
     89 		Ticked:         "[✓] ",
     90 		Unticked:       "[ ] ",
     91 	},
     92 	Link:     ansi.StylePrimitive{Color: stringPtr("33")},
     93 	LinkText: ansi.StylePrimitive{Bold: boolPtr(true)},
     94 	Image: ansi.StylePrimitive{
     95 		Color:     stringPtr("245"),
     96 		Underline: boolPtr(true),
     97 	},
     98 	ImageText: ansi.StylePrimitive{
     99 		Color:  stringPtr("88"),
    100 		Format: "Image: {{.text}} →",
    101 	},
    102 	Code: ansi.StyleBlock{
    103 		StylePrimitive: ansi.StylePrimitive{
    104 			Color:  stringPtr("200"),
    105 			Italic: boolPtr(true),
    106 		},
    107 	},
    108 	CodeBlock: ansi.StyleCodeBlock{
    109 		StyleBlock: ansi.StyleBlock{
    110 			StylePrimitive: ansi.StylePrimitive{
    111 				Color: stringPtr("244"),
    112 			},
    113 			Margin: uintPtr(2),
    114 		},
    115 		Chroma: &ansi.Chroma{
    116 			Text: ansi.StylePrimitive{
    117 				Color: stringPtr("#C4C4C4"),
    118 			},
    119 			Error: ansi.StylePrimitive{
    120 				Color:           stringPtr("#F1F1F1"),
    121 				BackgroundColor: stringPtr("#F05B5B"),
    122 			},
    123 			Comment: ansi.StylePrimitive{
    124 				Color: stringPtr("#676767"),
    125 			},
    126 			CommentPreproc: ansi.StylePrimitive{
    127 				Color: stringPtr("#FF875F"),
    128 			},
    129 			Keyword: ansi.StylePrimitive{
    130 				Color: stringPtr("#00AAFF"),
    131 			},
    132 			KeywordReserved: ansi.StylePrimitive{
    133 				Color: stringPtr("#FF5FD2"),
    134 			},
    135 			KeywordNamespace: ansi.StylePrimitive{
    136 				Color: stringPtr("#FF5F87"),
    137 			},
    138 			KeywordType: ansi.StylePrimitive{
    139 				Color: stringPtr("#6E6ED8"),
    140 			},
    141 			Operator: ansi.StylePrimitive{
    142 				Color: stringPtr("#EF8080"),
    143 			},
    144 			Punctuation: ansi.StylePrimitive{
    145 				Color: stringPtr("#E8E8A8"),
    146 			},
    147 			Name: ansi.StylePrimitive{
    148 				Color: stringPtr("#C4C4C4"),
    149 			},
    150 			NameBuiltin: ansi.StylePrimitive{
    151 				Color: stringPtr("#FF8EC7"),
    152 			},
    153 			NameTag: ansi.StylePrimitive{
    154 				Color: stringPtr("#B083EA"),
    155 			},
    156 			NameAttribute: ansi.StylePrimitive{
    157 				Color: stringPtr("#7A7AE6"),
    158 			},
    159 			NameClass: ansi.StylePrimitive{
    160 				Color:     stringPtr("#F1F1F1"),
    161 				Underline: boolPtr(true),
    162 				Bold:      boolPtr(true),
    163 			},
    164 			NameDecorator: ansi.StylePrimitive{
    165 				Color: stringPtr("#FFFF87"),
    166 			},
    167 			NameFunction: ansi.StylePrimitive{
    168 				Color: stringPtr("#00D787"),
    169 			},
    170 			LiteralNumber: ansi.StylePrimitive{
    171 				Color: stringPtr("#6EEFC0"),
    172 			},
    173 			LiteralString: ansi.StylePrimitive{
    174 				Color: stringPtr("#C69669"),
    175 			},
    176 			LiteralStringEscape: ansi.StylePrimitive{
    177 				Color: stringPtr("#AFFFD7"),
    178 			},
    179 			GenericDeleted: ansi.StylePrimitive{
    180 				Color: stringPtr("#FD5B5B"),
    181 			},
    182 			GenericEmph: ansi.StylePrimitive{
    183 				Italic: boolPtr(true),
    184 			},
    185 			GenericInserted: ansi.StylePrimitive{
    186 				Color: stringPtr("#00D787"),
    187 			},
    188 			GenericStrong: ansi.StylePrimitive{
    189 				Bold: boolPtr(true),
    190 			},
    191 			GenericSubheading: ansi.StylePrimitive{
    192 				Color: stringPtr("#777777"),
    193 			},
    194 			Background: ansi.StylePrimitive{
    195 				BackgroundColor: stringPtr("#373737"),
    196 			},
    197 		},
    198 	},
    199 	Table: ansi.StyleTable{
    200 		StyleBlock: ansi.StyleBlock{
    201 			StylePrimitive: ansi.StylePrimitive{},
    202 		},
    203 		CenterSeparator: stringPtr("┼"),
    204 		ColumnSeparator: stringPtr("│"),
    205 		RowSeparator:    stringPtr("─"),
    206 	},
    207 	DefinitionDescription: ansi.StylePrimitive{
    208 		BlockPrefix: "\n🠶 ",
    209 	},
    210 }
    211 
    212 func boolPtr(b bool) *bool       { return &b }
    213 func stringPtr(s string) *string { return &s }
    214 func uintPtr(u uint) *uint       { return &u }