1package styles
2
3import (
4 "github.com/charmbracelet/glamour/ansi"
5 "github.com/charmbracelet/lipgloss"
6)
7
8const defaultMargin = 1
9
10// Helper functions for style pointers
11func boolPtr(b bool) *bool { return &b }
12func stringPtr(s string) *string { return &s }
13func uintPtr(u uint) *uint { return &u }
14
15// CatppuccinMarkdownStyle is the Catppuccin Mocha style for Glamour markdown rendering.
16func CatppuccinMarkdownStyle() ansi.StyleConfig {
17 isDark := lipgloss.HasDarkBackground()
18 if isDark {
19 return catppuccinDark
20 }
21 return catppuccinLight
22}
23
24var catppuccinDark = ansi.StyleConfig{
25 Document: ansi.StyleBlock{
26 StylePrimitive: ansi.StylePrimitive{
27 BlockPrefix: "\n",
28 BlockSuffix: "",
29 Color: stringPtr(dark.Text().Hex),
30 },
31 Margin: uintPtr(defaultMargin),
32 },
33 BlockQuote: ansi.StyleBlock{
34 StylePrimitive: ansi.StylePrimitive{
35 Color: stringPtr(dark.Yellow().Hex),
36 Italic: boolPtr(true),
37 Prefix: "ā ",
38 },
39 Indent: uintPtr(1),
40 IndentToken: stringPtr(BaseStyle.Render(" ")),
41 },
42 List: ansi.StyleList{
43 LevelIndent: defaultMargin,
44 StyleBlock: ansi.StyleBlock{
45 IndentToken: stringPtr(BaseStyle.Render(" ")),
46 StylePrimitive: ansi.StylePrimitive{
47 Color: stringPtr(dark.Text().Hex),
48 },
49 },
50 },
51 Heading: ansi.StyleBlock{
52 StylePrimitive: ansi.StylePrimitive{
53 BlockSuffix: "\n",
54 Color: stringPtr(dark.Mauve().Hex),
55 Bold: boolPtr(true),
56 },
57 },
58 H1: ansi.StyleBlock{
59 StylePrimitive: ansi.StylePrimitive{
60 Prefix: "# ",
61 Color: stringPtr(dark.Lavender().Hex),
62 Bold: boolPtr(true),
63 BlockPrefix: "\n",
64 },
65 },
66 H2: ansi.StyleBlock{
67 StylePrimitive: ansi.StylePrimitive{
68 Prefix: "## ",
69 Color: stringPtr(dark.Mauve().Hex),
70 Bold: boolPtr(true),
71 },
72 },
73 H3: ansi.StyleBlock{
74 StylePrimitive: ansi.StylePrimitive{
75 Prefix: "### ",
76 Color: stringPtr(dark.Pink().Hex),
77 Bold: boolPtr(true),
78 },
79 },
80 H4: ansi.StyleBlock{
81 StylePrimitive: ansi.StylePrimitive{
82 Prefix: "#### ",
83 Color: stringPtr(dark.Flamingo().Hex),
84 Bold: boolPtr(true),
85 },
86 },
87 H5: ansi.StyleBlock{
88 StylePrimitive: ansi.StylePrimitive{
89 Prefix: "##### ",
90 Color: stringPtr(dark.Rosewater().Hex),
91 Bold: boolPtr(true),
92 },
93 },
94 H6: ansi.StyleBlock{
95 StylePrimitive: ansi.StylePrimitive{
96 Prefix: "###### ",
97 Color: stringPtr(dark.Rosewater().Hex),
98 Bold: boolPtr(true),
99 },
100 },
101 Strikethrough: ansi.StylePrimitive{
102 CrossedOut: boolPtr(true),
103 Color: stringPtr(dark.Overlay1().Hex),
104 },
105 Emph: ansi.StylePrimitive{
106 Color: stringPtr(dark.Yellow().Hex),
107 Italic: boolPtr(true),
108 },
109 Strong: ansi.StylePrimitive{
110 Bold: boolPtr(true),
111 Color: stringPtr(dark.Peach().Hex),
112 },
113 HorizontalRule: ansi.StylePrimitive{
114 Color: stringPtr(dark.Overlay0().Hex),
115 Format: "\nāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā\n",
116 },
117 Item: ansi.StylePrimitive{
118 BlockPrefix: "⢠",
119 Color: stringPtr(dark.Blue().Hex),
120 },
121 Enumeration: ansi.StylePrimitive{
122 BlockPrefix: ". ",
123 Color: stringPtr(dark.Sky().Hex),
124 },
125 Task: ansi.StyleTask{
126 StylePrimitive: ansi.StylePrimitive{},
127 Ticked: "[ā] ",
128 Unticked: "[ ] ",
129 },
130 Link: ansi.StylePrimitive{
131 Color: stringPtr(dark.Sky().Hex),
132 Underline: boolPtr(true),
133 },
134 LinkText: ansi.StylePrimitive{
135 Color: stringPtr(dark.Pink().Hex),
136 Bold: boolPtr(true),
137 },
138 Image: ansi.StylePrimitive{
139 Color: stringPtr(dark.Sapphire().Hex),
140 Underline: boolPtr(true),
141 Format: "š¼ {{.text}}",
142 },
143 ImageText: ansi.StylePrimitive{
144 Color: stringPtr(dark.Pink().Hex),
145 Format: "{{.text}}",
146 },
147 Code: ansi.StyleBlock{
148 StylePrimitive: ansi.StylePrimitive{
149 Color: stringPtr(dark.Green().Hex),
150 Prefix: "",
151 Suffix: "",
152 },
153 },
154 CodeBlock: ansi.StyleCodeBlock{
155 StyleBlock: ansi.StyleBlock{
156 StylePrimitive: ansi.StylePrimitive{
157 Prefix: " ",
158 Color: stringPtr(dark.Text().Hex),
159 },
160
161 Margin: uintPtr(defaultMargin),
162 },
163 Chroma: &ansi.Chroma{
164 Text: ansi.StylePrimitive{
165 Color: stringPtr(dark.Text().Hex),
166 },
167 Error: ansi.StylePrimitive{
168 Color: stringPtr(dark.Text().Hex),
169 },
170 Comment: ansi.StylePrimitive{
171 Color: stringPtr(dark.Overlay1().Hex),
172 },
173 CommentPreproc: ansi.StylePrimitive{
174 Color: stringPtr(dark.Pink().Hex),
175 },
176 Keyword: ansi.StylePrimitive{
177 Color: stringPtr(dark.Pink().Hex),
178 },
179 KeywordReserved: ansi.StylePrimitive{
180 Color: stringPtr(dark.Pink().Hex),
181 },
182 KeywordNamespace: ansi.StylePrimitive{
183 Color: stringPtr(dark.Pink().Hex),
184 },
185 KeywordType: ansi.StylePrimitive{
186 Color: stringPtr(dark.Sky().Hex),
187 },
188 Operator: ansi.StylePrimitive{
189 Color: stringPtr(dark.Pink().Hex),
190 },
191 Punctuation: ansi.StylePrimitive{
192 Color: stringPtr(dark.Text().Hex),
193 },
194 Name: ansi.StylePrimitive{
195 Color: stringPtr(dark.Sky().Hex),
196 },
197 NameBuiltin: ansi.StylePrimitive{
198 Color: stringPtr(dark.Sky().Hex),
199 },
200 NameTag: ansi.StylePrimitive{
201 Color: stringPtr(dark.Pink().Hex),
202 },
203 NameAttribute: ansi.StylePrimitive{
204 Color: stringPtr(dark.Green().Hex),
205 },
206 NameClass: ansi.StylePrimitive{
207 Color: stringPtr(dark.Sky().Hex),
208 },
209 NameConstant: ansi.StylePrimitive{
210 Color: stringPtr(dark.Mauve().Hex),
211 },
212 NameDecorator: ansi.StylePrimitive{
213 Color: stringPtr(dark.Green().Hex),
214 },
215 NameFunction: ansi.StylePrimitive{
216 Color: stringPtr(dark.Green().Hex),
217 },
218 LiteralNumber: ansi.StylePrimitive{
219 Color: stringPtr(dark.Teal().Hex),
220 },
221 LiteralString: ansi.StylePrimitive{
222 Color: stringPtr(dark.Yellow().Hex),
223 },
224 LiteralStringEscape: ansi.StylePrimitive{
225 Color: stringPtr(dark.Pink().Hex),
226 },
227 GenericDeleted: ansi.StylePrimitive{
228 Color: stringPtr(dark.Red().Hex),
229 },
230 GenericEmph: ansi.StylePrimitive{
231 Color: stringPtr(dark.Yellow().Hex),
232 Italic: boolPtr(true),
233 },
234 GenericInserted: ansi.StylePrimitive{
235 Color: stringPtr(dark.Green().Hex),
236 },
237 GenericStrong: ansi.StylePrimitive{
238 Color: stringPtr(dark.Peach().Hex),
239 Bold: boolPtr(true),
240 },
241 GenericSubheading: ansi.StylePrimitive{
242 Color: stringPtr(dark.Mauve().Hex),
243 },
244 },
245 },
246 Table: ansi.StyleTable{
247 StyleBlock: ansi.StyleBlock{
248 StylePrimitive: ansi.StylePrimitive{
249 BlockPrefix: "\n",
250 BlockSuffix: "\n",
251 },
252 },
253 CenterSeparator: stringPtr("ā¼"),
254 ColumnSeparator: stringPtr("ā"),
255 RowSeparator: stringPtr("ā"),
256 },
257 DefinitionDescription: ansi.StylePrimitive{
258 BlockPrefix: "\n ⯠",
259 Color: stringPtr(dark.Sapphire().Hex),
260 },
261}
262
263var catppuccinLight = ansi.StyleConfig{
264 Document: ansi.StyleBlock{
265 StylePrimitive: ansi.StylePrimitive{
266 BlockPrefix: "\n",
267 BlockSuffix: "\n",
268 Color: stringPtr(light.Text().Hex),
269 },
270 Margin: uintPtr(defaultMargin),
271 },
272 BlockQuote: ansi.StyleBlock{
273 StylePrimitive: ansi.StylePrimitive{
274 Color: stringPtr(light.Yellow().Hex),
275 Italic: boolPtr(true),
276 Prefix: "ā ",
277 },
278 Indent: uintPtr(1),
279 Margin: uintPtr(defaultMargin),
280 },
281 List: ansi.StyleList{
282 LevelIndent: defaultMargin,
283 StyleBlock: ansi.StyleBlock{
284 StylePrimitive: ansi.StylePrimitive{
285 Color: stringPtr(light.Text().Hex),
286 },
287 },
288 },
289 Heading: ansi.StyleBlock{
290 StylePrimitive: ansi.StylePrimitive{
291 BlockSuffix: "\n",
292 Color: stringPtr(light.Mauve().Hex),
293 Bold: boolPtr(true),
294 },
295 },
296 H1: ansi.StyleBlock{
297 StylePrimitive: ansi.StylePrimitive{
298 Prefix: "# ",
299 Color: stringPtr(light.Lavender().Hex),
300 Bold: boolPtr(true),
301 BlockPrefix: "\n",
302 },
303 },
304 H2: ansi.StyleBlock{
305 StylePrimitive: ansi.StylePrimitive{
306 Prefix: "## ",
307 Color: stringPtr(light.Mauve().Hex),
308 Bold: boolPtr(true),
309 },
310 },
311 H3: ansi.StyleBlock{
312 StylePrimitive: ansi.StylePrimitive{
313 Prefix: "### ",
314 Color: stringPtr(light.Pink().Hex),
315 Bold: boolPtr(true),
316 },
317 },
318 H4: ansi.StyleBlock{
319 StylePrimitive: ansi.StylePrimitive{
320 Prefix: "#### ",
321 Color: stringPtr(light.Flamingo().Hex),
322 Bold: boolPtr(true),
323 },
324 },
325 H5: ansi.StyleBlock{
326 StylePrimitive: ansi.StylePrimitive{
327 Prefix: "##### ",
328 Color: stringPtr(light.Rosewater().Hex),
329 Bold: boolPtr(true),
330 },
331 },
332 H6: ansi.StyleBlock{
333 StylePrimitive: ansi.StylePrimitive{
334 Prefix: "###### ",
335 Color: stringPtr(light.Rosewater().Hex),
336 Bold: boolPtr(true),
337 },
338 },
339 Strikethrough: ansi.StylePrimitive{
340 CrossedOut: boolPtr(true),
341 Color: stringPtr(light.Overlay1().Hex),
342 },
343 Emph: ansi.StylePrimitive{
344 Color: stringPtr(light.Yellow().Hex),
345 Italic: boolPtr(true),
346 },
347 Strong: ansi.StylePrimitive{
348 Bold: boolPtr(true),
349 Color: stringPtr(light.Peach().Hex),
350 },
351 HorizontalRule: ansi.StylePrimitive{
352 Color: stringPtr(light.Overlay0().Hex),
353 Format: "\nāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā\n",
354 },
355 Item: ansi.StylePrimitive{
356 BlockPrefix: "⢠",
357 Color: stringPtr(light.Blue().Hex),
358 },
359 Enumeration: ansi.StylePrimitive{
360 BlockPrefix: ". ",
361 Color: stringPtr(light.Sky().Hex),
362 },
363 Task: ansi.StyleTask{
364 StylePrimitive: ansi.StylePrimitive{},
365 Ticked: "[ā] ",
366 Unticked: "[ ] ",
367 },
368 Link: ansi.StylePrimitive{
369 Color: stringPtr(light.Sky().Hex),
370 Underline: boolPtr(true),
371 },
372 LinkText: ansi.StylePrimitive{
373 Color: stringPtr(light.Pink().Hex),
374 Bold: boolPtr(true),
375 },
376 Image: ansi.StylePrimitive{
377 Color: stringPtr(light.Sapphire().Hex),
378 Underline: boolPtr(true),
379 Format: "š¼ {{.text}}",
380 },
381 ImageText: ansi.StylePrimitive{
382 Color: stringPtr(light.Pink().Hex),
383 Format: "{{.text}}",
384 },
385 Code: ansi.StyleBlock{
386 StylePrimitive: ansi.StylePrimitive{
387 Color: stringPtr(light.Green().Hex),
388 Prefix: " ",
389 Suffix: " ",
390 },
391 },
392 CodeBlock: ansi.StyleCodeBlock{
393 StyleBlock: ansi.StyleBlock{
394 StylePrimitive: ansi.StylePrimitive{
395 Prefix: " ",
396 Color: stringPtr(light.Text().Hex),
397 },
398
399 Margin: uintPtr(defaultMargin),
400 },
401 Chroma: &ansi.Chroma{
402 Text: ansi.StylePrimitive{
403 Color: stringPtr(light.Text().Hex),
404 },
405 Error: ansi.StylePrimitive{
406 Color: stringPtr(light.Text().Hex),
407 },
408 Comment: ansi.StylePrimitive{
409 Color: stringPtr(light.Overlay1().Hex),
410 },
411 CommentPreproc: ansi.StylePrimitive{
412 Color: stringPtr(light.Pink().Hex),
413 },
414 Keyword: ansi.StylePrimitive{
415 Color: stringPtr(light.Pink().Hex),
416 },
417 KeywordReserved: ansi.StylePrimitive{
418 Color: stringPtr(light.Pink().Hex),
419 },
420 KeywordNamespace: ansi.StylePrimitive{
421 Color: stringPtr(light.Pink().Hex),
422 },
423 KeywordType: ansi.StylePrimitive{
424 Color: stringPtr(light.Sky().Hex),
425 },
426 Operator: ansi.StylePrimitive{
427 Color: stringPtr(light.Pink().Hex),
428 },
429 Punctuation: ansi.StylePrimitive{
430 Color: stringPtr(light.Text().Hex),
431 },
432 Name: ansi.StylePrimitive{
433 Color: stringPtr(light.Sky().Hex),
434 },
435 NameBuiltin: ansi.StylePrimitive{
436 Color: stringPtr(light.Sky().Hex),
437 },
438 NameTag: ansi.StylePrimitive{
439 Color: stringPtr(light.Pink().Hex),
440 },
441 NameAttribute: ansi.StylePrimitive{
442 Color: stringPtr(light.Green().Hex),
443 },
444 NameClass: ansi.StylePrimitive{
445 Color: stringPtr(light.Sky().Hex),
446 },
447 NameConstant: ansi.StylePrimitive{
448 Color: stringPtr(light.Mauve().Hex),
449 },
450 NameDecorator: ansi.StylePrimitive{
451 Color: stringPtr(light.Green().Hex),
452 },
453 NameFunction: ansi.StylePrimitive{
454 Color: stringPtr(light.Green().Hex),
455 },
456 LiteralNumber: ansi.StylePrimitive{
457 Color: stringPtr(light.Teal().Hex),
458 },
459 LiteralString: ansi.StylePrimitive{
460 Color: stringPtr(light.Yellow().Hex),
461 },
462 LiteralStringEscape: ansi.StylePrimitive{
463 Color: stringPtr(light.Pink().Hex),
464 },
465 GenericDeleted: ansi.StylePrimitive{
466 Color: stringPtr(light.Red().Hex),
467 },
468 GenericEmph: ansi.StylePrimitive{
469 Color: stringPtr(light.Yellow().Hex),
470 Italic: boolPtr(true),
471 },
472 GenericInserted: ansi.StylePrimitive{
473 Color: stringPtr(light.Green().Hex),
474 },
475 GenericStrong: ansi.StylePrimitive{
476 Color: stringPtr(light.Peach().Hex),
477 Bold: boolPtr(true),
478 },
479 GenericSubheading: ansi.StylePrimitive{
480 Color: stringPtr(light.Mauve().Hex),
481 },
482 },
483 },
484 Table: ansi.StyleTable{
485 StyleBlock: ansi.StyleBlock{
486 StylePrimitive: ansi.StylePrimitive{
487 BlockPrefix: "\n",
488 BlockSuffix: "\n",
489 },
490 },
491 CenterSeparator: stringPtr("ā¼"),
492 ColumnSeparator: stringPtr("ā"),
493 RowSeparator: stringPtr("ā"),
494 },
495 DefinitionDescription: ansi.StylePrimitive{
496 BlockPrefix: "\n ⯠",
497 Color: stringPtr(light.Sapphire().Hex),
498 },
499}
500
501func MarkdownTheme(focused bool) ansi.StyleConfig {
502 if !focused {
503 return ASCIIStyleConfig
504 } else {
505 return DraculaStyleConfig
506 }
507}
508
509const (
510 defaultListIndent = 2
511 defaultListLevelIndent = 4
512)
513
514var ASCIIStyleConfig = ansi.StyleConfig{
515 Document: ansi.StyleBlock{
516 StylePrimitive: ansi.StylePrimitive{
517 BackgroundColor: stringPtr(Background.Dark),
518 Color: stringPtr(ForgroundDim.Dark),
519 },
520 Indent: uintPtr(1),
521 IndentToken: stringPtr(BaseStyle.Render(" ")),
522 },
523 BlockQuote: ansi.StyleBlock{
524 StylePrimitive: ansi.StylePrimitive{
525 BackgroundColor: stringPtr(Background.Dark),
526 },
527 Indent: uintPtr(1),
528 IndentToken: stringPtr("| "),
529 },
530 Paragraph: ansi.StyleBlock{
531 StylePrimitive: ansi.StylePrimitive{
532 BackgroundColor: stringPtr(Background.Dark),
533 },
534 },
535 List: ansi.StyleList{
536 StyleBlock: ansi.StyleBlock{
537 IndentToken: stringPtr(BaseStyle.Render(" ")),
538 StylePrimitive: ansi.StylePrimitive{
539 BackgroundColor: stringPtr(Background.Dark),
540 },
541 },
542 LevelIndent: defaultListLevelIndent,
543 },
544 Heading: ansi.StyleBlock{
545 StylePrimitive: ansi.StylePrimitive{
546 BackgroundColor: stringPtr(Background.Dark),
547 BlockSuffix: "\n",
548 },
549 },
550 H1: ansi.StyleBlock{
551 StylePrimitive: ansi.StylePrimitive{
552 BackgroundColor: stringPtr(Background.Dark),
553 Prefix: "# ",
554 },
555 },
556 H2: ansi.StyleBlock{
557 StylePrimitive: ansi.StylePrimitive{
558 BackgroundColor: stringPtr(Background.Dark),
559 Prefix: "## ",
560 },
561 },
562 H3: ansi.StyleBlock{
563 StylePrimitive: ansi.StylePrimitive{
564 BackgroundColor: stringPtr(Background.Dark),
565 Prefix: "### ",
566 },
567 },
568 H4: ansi.StyleBlock{
569 StylePrimitive: ansi.StylePrimitive{
570 BackgroundColor: stringPtr(Background.Dark),
571 Prefix: "#### ",
572 },
573 },
574 H5: ansi.StyleBlock{
575 StylePrimitive: ansi.StylePrimitive{
576 BackgroundColor: stringPtr(Background.Dark),
577 Prefix: "##### ",
578 },
579 },
580 H6: ansi.StyleBlock{
581 StylePrimitive: ansi.StylePrimitive{
582 BackgroundColor: stringPtr(Background.Dark),
583 Prefix: "###### ",
584 },
585 },
586 Strikethrough: ansi.StylePrimitive{
587 BackgroundColor: stringPtr(Background.Dark),
588 BlockPrefix: "~~",
589 BlockSuffix: "~~",
590 },
591 Emph: ansi.StylePrimitive{
592 BackgroundColor: stringPtr(Background.Dark),
593 BlockPrefix: "*",
594 BlockSuffix: "*",
595 },
596 Strong: ansi.StylePrimitive{
597 BackgroundColor: stringPtr(Background.Dark),
598 BlockPrefix: "**",
599 BlockSuffix: "**",
600 },
601 HorizontalRule: ansi.StylePrimitive{
602 BackgroundColor: stringPtr(Background.Dark),
603 Format: "\n--------\n",
604 },
605 Item: ansi.StylePrimitive{
606 BlockPrefix: "⢠",
607 BackgroundColor: stringPtr(Background.Dark),
608 },
609 Enumeration: ansi.StylePrimitive{
610 BlockPrefix: ". ",
611 BackgroundColor: stringPtr(Background.Dark),
612 },
613 Task: ansi.StyleTask{
614 Ticked: "[x] ",
615 Unticked: "[ ] ",
616 StylePrimitive: ansi.StylePrimitive{
617 BackgroundColor: stringPtr(Background.Dark),
618 },
619 },
620 ImageText: ansi.StylePrimitive{
621 BackgroundColor: stringPtr(Background.Dark),
622 Format: "Image: {{.text}} ā",
623 },
624 Code: ansi.StyleBlock{
625 StylePrimitive: ansi.StylePrimitive{
626 BlockPrefix: "`",
627 BlockSuffix: "`",
628 BackgroundColor: stringPtr(Background.Dark),
629 },
630 },
631 CodeBlock: ansi.StyleCodeBlock{
632 StyleBlock: ansi.StyleBlock{
633 StylePrimitive: ansi.StylePrimitive{
634 BackgroundColor: stringPtr(Background.Dark),
635 },
636 Margin: uintPtr(defaultMargin),
637 },
638 },
639 Table: ansi.StyleTable{
640 StyleBlock: ansi.StyleBlock{
641 StylePrimitive: ansi.StylePrimitive{
642 BackgroundColor: stringPtr(Background.Dark),
643 },
644 IndentToken: stringPtr(BaseStyle.Render(" ")),
645 },
646 CenterSeparator: stringPtr("|"),
647 ColumnSeparator: stringPtr("|"),
648 RowSeparator: stringPtr("-"),
649 },
650 DefinitionDescription: ansi.StylePrimitive{
651 BackgroundColor: stringPtr(Background.Dark),
652 BlockPrefix: "\n* ",
653 },
654}
655
656var DraculaStyleConfig = ansi.StyleConfig{
657 Document: ansi.StyleBlock{
658 StylePrimitive: ansi.StylePrimitive{
659 Color: stringPtr(Forground.Dark),
660 BackgroundColor: stringPtr(Background.Dark),
661 },
662 Indent: uintPtr(defaultMargin),
663 IndentToken: stringPtr(BaseStyle.Render(" ")),
664 },
665 BlockQuote: ansi.StyleBlock{
666 StylePrimitive: ansi.StylePrimitive{
667 Color: stringPtr("#f1fa8c"),
668 Italic: boolPtr(true),
669 BackgroundColor: stringPtr(Background.Dark),
670 },
671 Indent: uintPtr(defaultMargin),
672 IndentToken: stringPtr(BaseStyle.Render(" ")),
673 },
674 Paragraph: ansi.StyleBlock{
675 StylePrimitive: ansi.StylePrimitive{
676 BackgroundColor: stringPtr(Background.Dark),
677 },
678 },
679 List: ansi.StyleList{
680 LevelIndent: defaultMargin,
681 StyleBlock: ansi.StyleBlock{
682 IndentToken: stringPtr(BaseStyle.Render(" ")),
683 StylePrimitive: ansi.StylePrimitive{
684 Color: stringPtr(Forground.Dark),
685 BackgroundColor: stringPtr(Background.Dark),
686 },
687 },
688 },
689 Heading: ansi.StyleBlock{
690 StylePrimitive: ansi.StylePrimitive{
691 BlockSuffix: "\n",
692 Color: stringPtr(PrimaryColor.Dark),
693 Bold: boolPtr(true),
694 BackgroundColor: stringPtr(Background.Dark),
695 },
696 },
697 H1: ansi.StyleBlock{
698 StylePrimitive: ansi.StylePrimitive{
699 Prefix: "# ",
700 BackgroundColor: stringPtr(Background.Dark),
701 },
702 },
703 H2: ansi.StyleBlock{
704 StylePrimitive: ansi.StylePrimitive{
705 Prefix: "## ",
706 BackgroundColor: stringPtr(Background.Dark),
707 },
708 },
709 H3: ansi.StyleBlock{
710 StylePrimitive: ansi.StylePrimitive{
711 Prefix: "### ",
712 BackgroundColor: stringPtr(Background.Dark),
713 },
714 },
715 H4: ansi.StyleBlock{
716 StylePrimitive: ansi.StylePrimitive{
717 Prefix: "#### ",
718 BackgroundColor: stringPtr(Background.Dark),
719 },
720 },
721 H5: ansi.StyleBlock{
722 StylePrimitive: ansi.StylePrimitive{
723 Prefix: "##### ",
724 BackgroundColor: stringPtr(Background.Dark),
725 },
726 },
727 H6: ansi.StyleBlock{
728 StylePrimitive: ansi.StylePrimitive{
729 Prefix: "###### ",
730 BackgroundColor: stringPtr(Background.Dark),
731 },
732 },
733 Strikethrough: ansi.StylePrimitive{
734 CrossedOut: boolPtr(true),
735 BackgroundColor: stringPtr(Background.Dark),
736 },
737 Emph: ansi.StylePrimitive{
738 Color: stringPtr("#f1fa8c"),
739 Italic: boolPtr(true),
740 BackgroundColor: stringPtr(Background.Dark),
741 },
742 Strong: ansi.StylePrimitive{
743 Bold: boolPtr(true),
744 Color: stringPtr(Blue.Dark),
745 BackgroundColor: stringPtr(Background.Dark),
746 },
747 HorizontalRule: ansi.StylePrimitive{
748 Color: stringPtr("#6272A4"),
749 Format: "\n--------\n",
750 BackgroundColor: stringPtr(Background.Dark),
751 },
752 Item: ansi.StylePrimitive{
753 BlockPrefix: "⢠",
754 BackgroundColor: stringPtr(Background.Dark),
755 },
756 Enumeration: ansi.StylePrimitive{
757 BlockPrefix: ". ",
758 Color: stringPtr("#8be9fd"),
759 BackgroundColor: stringPtr(Background.Dark),
760 },
761 Task: ansi.StyleTask{
762 StylePrimitive: ansi.StylePrimitive{
763 BackgroundColor: stringPtr(Background.Dark),
764 },
765 Ticked: "[ā] ",
766 Unticked: "[ ] ",
767 },
768 Link: ansi.StylePrimitive{
769 Color: stringPtr("#8be9fd"),
770 Underline: boolPtr(true),
771 BackgroundColor: stringPtr(Background.Dark),
772 },
773 LinkText: ansi.StylePrimitive{
774 Color: stringPtr("#ff79c6"),
775 BackgroundColor: stringPtr(Background.Dark),
776 },
777 Image: ansi.StylePrimitive{
778 Color: stringPtr("#8be9fd"),
779 Underline: boolPtr(true),
780 BackgroundColor: stringPtr(Background.Dark),
781 },
782 ImageText: ansi.StylePrimitive{
783 Color: stringPtr("#ff79c6"),
784 Format: "Image: {{.text}} ā",
785 BackgroundColor: stringPtr(Background.Dark),
786 },
787 Code: ansi.StyleBlock{
788 StylePrimitive: ansi.StylePrimitive{
789 Color: stringPtr("#50fa7b"),
790 BackgroundColor: stringPtr(Background.Dark),
791 },
792 },
793 Text: ansi.StylePrimitive{
794 BackgroundColor: stringPtr(Background.Dark),
795 },
796 DefinitionList: ansi.StyleBlock{},
797 CodeBlock: ansi.StyleCodeBlock{
798 StyleBlock: ansi.StyleBlock{
799 StylePrimitive: ansi.StylePrimitive{
800 Color: stringPtr(Blue.Dark),
801 BackgroundColor: stringPtr(Background.Dark),
802 },
803 Margin: uintPtr(defaultMargin),
804 },
805 Chroma: &ansi.Chroma{
806 NameOther: ansi.StylePrimitive{
807 BackgroundColor: stringPtr(Background.Dark),
808 },
809 Literal: ansi.StylePrimitive{
810 BackgroundColor: stringPtr(Background.Dark),
811 },
812 NameException: ansi.StylePrimitive{
813 BackgroundColor: stringPtr(Background.Dark),
814 },
815 LiteralDate: ansi.StylePrimitive{
816 BackgroundColor: stringPtr(Background.Dark),
817 },
818 Text: ansi.StylePrimitive{
819 Color: stringPtr(Forground.Dark),
820 BackgroundColor: stringPtr(Background.Dark),
821 },
822 Error: ansi.StylePrimitive{
823 Color: stringPtr("#f8f8f2"),
824 BackgroundColor: stringPtr("#ff5555"),
825 },
826 Comment: ansi.StylePrimitive{
827 Color: stringPtr("#6272A4"),
828 BackgroundColor: stringPtr(Background.Dark),
829 },
830 CommentPreproc: ansi.StylePrimitive{
831 Color: stringPtr("#ff79c6"),
832 BackgroundColor: stringPtr(Background.Dark),
833 },
834 Keyword: ansi.StylePrimitive{
835 Color: stringPtr("#ff79c6"),
836 BackgroundColor: stringPtr(Background.Dark),
837 },
838 KeywordReserved: ansi.StylePrimitive{
839 Color: stringPtr("#ff79c6"),
840 BackgroundColor: stringPtr(Background.Dark),
841 },
842 KeywordNamespace: ansi.StylePrimitive{
843 Color: stringPtr("#ff79c6"),
844 BackgroundColor: stringPtr(Background.Dark),
845 },
846 KeywordType: ansi.StylePrimitive{
847 Color: stringPtr("#8be9fd"),
848 BackgroundColor: stringPtr(Background.Dark),
849 },
850 Operator: ansi.StylePrimitive{
851 Color: stringPtr("#ff79c6"),
852 BackgroundColor: stringPtr(Background.Dark),
853 },
854 Punctuation: ansi.StylePrimitive{
855 Color: stringPtr(Forground.Dark),
856 BackgroundColor: stringPtr(Background.Dark),
857 },
858 Name: ansi.StylePrimitive{
859 Color: stringPtr("#8be9fd"),
860 BackgroundColor: stringPtr(Background.Dark),
861 },
862 NameBuiltin: ansi.StylePrimitive{
863 Color: stringPtr("#8be9fd"),
864 BackgroundColor: stringPtr(Background.Dark),
865 },
866 NameTag: ansi.StylePrimitive{
867 Color: stringPtr("#ff79c6"),
868 BackgroundColor: stringPtr(Background.Dark),
869 },
870 NameAttribute: ansi.StylePrimitive{
871 Color: stringPtr("#50fa7b"),
872 BackgroundColor: stringPtr(Background.Dark),
873 },
874 NameClass: ansi.StylePrimitive{
875 Color: stringPtr("#8be9fd"),
876 BackgroundColor: stringPtr(Background.Dark),
877 },
878 NameConstant: ansi.StylePrimitive{
879 Color: stringPtr("#bd93f9"),
880 BackgroundColor: stringPtr(Background.Dark),
881 },
882 NameDecorator: ansi.StylePrimitive{
883 Color: stringPtr("#50fa7b"),
884 BackgroundColor: stringPtr(Background.Dark),
885 },
886 NameFunction: ansi.StylePrimitive{
887 Color: stringPtr("#50fa7b"),
888 BackgroundColor: stringPtr(Background.Dark),
889 },
890 LiteralNumber: ansi.StylePrimitive{
891 Color: stringPtr("#6EEFC0"),
892 BackgroundColor: stringPtr(Background.Dark),
893 },
894 LiteralString: ansi.StylePrimitive{
895 Color: stringPtr("#f1fa8c"),
896 BackgroundColor: stringPtr(Background.Dark),
897 },
898 LiteralStringEscape: ansi.StylePrimitive{
899 Color: stringPtr("#ff79c6"),
900 BackgroundColor: stringPtr(Background.Dark),
901 },
902 GenericDeleted: ansi.StylePrimitive{
903 Color: stringPtr("#ff5555"),
904 BackgroundColor: stringPtr(Background.Dark),
905 },
906 GenericEmph: ansi.StylePrimitive{
907 Color: stringPtr("#f1fa8c"),
908 Italic: boolPtr(true),
909 BackgroundColor: stringPtr(Background.Dark),
910 },
911 GenericInserted: ansi.StylePrimitive{
912 Color: stringPtr("#50fa7b"),
913 BackgroundColor: stringPtr(Background.Dark),
914 },
915 GenericStrong: ansi.StylePrimitive{
916 Color: stringPtr("#ffb86c"),
917 Bold: boolPtr(true),
918 BackgroundColor: stringPtr(Background.Dark),
919 },
920 GenericSubheading: ansi.StylePrimitive{
921 Color: stringPtr("#bd93f9"),
922 BackgroundColor: stringPtr(Background.Dark),
923 },
924 Background: ansi.StylePrimitive{
925 BackgroundColor: stringPtr(Background.Dark),
926 },
927 },
928 },
929 Table: ansi.StyleTable{
930 StyleBlock: ansi.StyleBlock{
931 StylePrimitive: ansi.StylePrimitive{
932 BackgroundColor: stringPtr(Background.Dark),
933 },
934 IndentToken: stringPtr(BaseStyle.Render(" ")),
935 },
936 },
937 DefinitionDescription: ansi.StylePrimitive{
938 BlockPrefix: "\n* ",
939 BackgroundColor: stringPtr(Background.Dark),
940 },
941}