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 },
519 Indent: uintPtr(1),
520 IndentToken: stringPtr(BaseStyle.Render(" ")),
521 },
522 BlockQuote: ansi.StyleBlock{
523 StylePrimitive: ansi.StylePrimitive{
524 BackgroundColor: stringPtr(Background.Dark),
525 },
526 Indent: uintPtr(1),
527 IndentToken: stringPtr("| "),
528 },
529 Paragraph: ansi.StyleBlock{
530 StylePrimitive: ansi.StylePrimitive{
531 BackgroundColor: stringPtr(Background.Dark),
532 },
533 },
534 List: ansi.StyleList{
535 StyleBlock: ansi.StyleBlock{
536 IndentToken: stringPtr(BaseStyle.Render(" ")),
537 StylePrimitive: ansi.StylePrimitive{
538 BackgroundColor: stringPtr(Background.Dark),
539 },
540 },
541 LevelIndent: defaultListLevelIndent,
542 },
543 Heading: ansi.StyleBlock{
544 StylePrimitive: ansi.StylePrimitive{
545 BackgroundColor: stringPtr(Background.Dark),
546 BlockSuffix: "\n",
547 },
548 },
549 H1: ansi.StyleBlock{
550 StylePrimitive: ansi.StylePrimitive{
551 BackgroundColor: stringPtr(Background.Dark),
552 Prefix: "# ",
553 },
554 },
555 H2: ansi.StyleBlock{
556 StylePrimitive: ansi.StylePrimitive{
557 BackgroundColor: stringPtr(Background.Dark),
558 Prefix: "## ",
559 },
560 },
561 H3: ansi.StyleBlock{
562 StylePrimitive: ansi.StylePrimitive{
563 BackgroundColor: stringPtr(Background.Dark),
564 Prefix: "### ",
565 },
566 },
567 H4: ansi.StyleBlock{
568 StylePrimitive: ansi.StylePrimitive{
569 BackgroundColor: stringPtr(Background.Dark),
570 Prefix: "#### ",
571 },
572 },
573 H5: ansi.StyleBlock{
574 StylePrimitive: ansi.StylePrimitive{
575 BackgroundColor: stringPtr(Background.Dark),
576 Prefix: "##### ",
577 },
578 },
579 H6: ansi.StyleBlock{
580 StylePrimitive: ansi.StylePrimitive{
581 BackgroundColor: stringPtr(Background.Dark),
582 Prefix: "###### ",
583 },
584 },
585 Strikethrough: ansi.StylePrimitive{
586 BackgroundColor: stringPtr(Background.Dark),
587 BlockPrefix: "~~",
588 BlockSuffix: "~~",
589 },
590 Emph: ansi.StylePrimitive{
591 BackgroundColor: stringPtr(Background.Dark),
592 BlockPrefix: "*",
593 BlockSuffix: "*",
594 },
595 Strong: ansi.StylePrimitive{
596 BackgroundColor: stringPtr(Background.Dark),
597 BlockPrefix: "**",
598 BlockSuffix: "**",
599 },
600 HorizontalRule: ansi.StylePrimitive{
601 BackgroundColor: stringPtr(Background.Dark),
602 Format: "\n--------\n",
603 },
604 Item: ansi.StylePrimitive{
605 BlockPrefix: "⢠",
606 BackgroundColor: stringPtr(Background.Dark),
607 },
608 Enumeration: ansi.StylePrimitive{
609 BlockPrefix: ". ",
610 BackgroundColor: stringPtr(Background.Dark),
611 },
612 Task: ansi.StyleTask{
613 Ticked: "[x] ",
614 Unticked: "[ ] ",
615 StylePrimitive: ansi.StylePrimitive{
616 BackgroundColor: stringPtr(Background.Dark),
617 },
618 },
619 ImageText: ansi.StylePrimitive{
620 BackgroundColor: stringPtr(Background.Dark),
621 Format: "Image: {{.text}} ā",
622 },
623 Code: ansi.StyleBlock{
624 StylePrimitive: ansi.StylePrimitive{
625 BlockPrefix: "`",
626 BlockSuffix: "`",
627 BackgroundColor: stringPtr(Background.Dark),
628 },
629 },
630 CodeBlock: ansi.StyleCodeBlock{
631 StyleBlock: ansi.StyleBlock{
632 StylePrimitive: ansi.StylePrimitive{
633 BackgroundColor: stringPtr(Background.Dark),
634 },
635 Margin: uintPtr(defaultMargin),
636 },
637 },
638 Table: ansi.StyleTable{
639 StyleBlock: ansi.StyleBlock{
640 StylePrimitive: ansi.StylePrimitive{
641 BackgroundColor: stringPtr(Background.Dark),
642 },
643 IndentToken: stringPtr(BaseStyle.Render(" ")),
644 },
645 CenterSeparator: stringPtr("|"),
646 ColumnSeparator: stringPtr("|"),
647 RowSeparator: stringPtr("-"),
648 },
649 DefinitionDescription: ansi.StylePrimitive{
650 BackgroundColor: stringPtr(Background.Dark),
651 BlockPrefix: "\n* ",
652 },
653}
654
655var DraculaStyleConfig = ansi.StyleConfig{
656 Document: ansi.StyleBlock{
657 StylePrimitive: ansi.StylePrimitive{
658 Color: stringPtr(Forground.Dark),
659 BackgroundColor: stringPtr(Background.Dark),
660 },
661 Indent: uintPtr(defaultMargin),
662 IndentToken: stringPtr(BaseStyle.Render(" ")),
663 },
664 BlockQuote: ansi.StyleBlock{
665 StylePrimitive: ansi.StylePrimitive{
666 Color: stringPtr("#f1fa8c"),
667 Italic: boolPtr(true),
668 BackgroundColor: stringPtr(Background.Dark),
669 },
670 Indent: uintPtr(defaultMargin),
671 IndentToken: stringPtr(BaseStyle.Render(" ")),
672 },
673 Paragraph: ansi.StyleBlock{
674 StylePrimitive: ansi.StylePrimitive{
675 BackgroundColor: stringPtr(Background.Dark),
676 },
677 },
678 List: ansi.StyleList{
679 LevelIndent: defaultMargin,
680 StyleBlock: ansi.StyleBlock{
681 IndentToken: stringPtr(BaseStyle.Render(" ")),
682 StylePrimitive: ansi.StylePrimitive{
683 Color: stringPtr(Forground.Dark),
684 BackgroundColor: stringPtr(Background.Dark),
685 },
686 },
687 },
688 Heading: ansi.StyleBlock{
689 StylePrimitive: ansi.StylePrimitive{
690 BlockSuffix: "\n",
691 Color: stringPtr("#bd93f9"),
692 Bold: boolPtr(true),
693 BackgroundColor: stringPtr(Background.Dark),
694 },
695 },
696 H1: ansi.StyleBlock{
697 StylePrimitive: ansi.StylePrimitive{
698 Prefix: "# ",
699 BackgroundColor: stringPtr(Background.Dark),
700 },
701 },
702 H2: ansi.StyleBlock{
703 StylePrimitive: ansi.StylePrimitive{
704 Prefix: "## ",
705 BackgroundColor: stringPtr(Background.Dark),
706 },
707 },
708 H3: ansi.StyleBlock{
709 StylePrimitive: ansi.StylePrimitive{
710 Prefix: "### ",
711 BackgroundColor: stringPtr(Background.Dark),
712 },
713 },
714 H4: ansi.StyleBlock{
715 StylePrimitive: ansi.StylePrimitive{
716 Prefix: "#### ",
717 BackgroundColor: stringPtr(Background.Dark),
718 },
719 },
720 H5: ansi.StyleBlock{
721 StylePrimitive: ansi.StylePrimitive{
722 Prefix: "##### ",
723 BackgroundColor: stringPtr(Background.Dark),
724 },
725 },
726 H6: ansi.StyleBlock{
727 StylePrimitive: ansi.StylePrimitive{
728 Prefix: "###### ",
729 BackgroundColor: stringPtr(Background.Dark),
730 },
731 },
732 Strikethrough: ansi.StylePrimitive{
733 CrossedOut: boolPtr(true),
734 BackgroundColor: stringPtr(Background.Dark),
735 },
736 Emph: ansi.StylePrimitive{
737 Color: stringPtr("#f1fa8c"),
738 Italic: boolPtr(true),
739 BackgroundColor: stringPtr(Background.Dark),
740 },
741 Strong: ansi.StylePrimitive{
742 Bold: boolPtr(true),
743 Color: stringPtr("#ffb86c"),
744 BackgroundColor: stringPtr(Background.Dark),
745 },
746 HorizontalRule: ansi.StylePrimitive{
747 Color: stringPtr("#6272A4"),
748 Format: "\n--------\n",
749 BackgroundColor: stringPtr(Background.Dark),
750 },
751 Item: ansi.StylePrimitive{
752 BlockPrefix: "⢠",
753 BackgroundColor: stringPtr(Background.Dark),
754 },
755 Enumeration: ansi.StylePrimitive{
756 BlockPrefix: ". ",
757 Color: stringPtr("#8be9fd"),
758 BackgroundColor: stringPtr(Background.Dark),
759 },
760 Task: ansi.StyleTask{
761 StylePrimitive: ansi.StylePrimitive{
762 BackgroundColor: stringPtr(Background.Dark),
763 },
764 Ticked: "[ā] ",
765 Unticked: "[ ] ",
766 },
767 Link: ansi.StylePrimitive{
768 Color: stringPtr("#8be9fd"),
769 Underline: boolPtr(true),
770 BackgroundColor: stringPtr(Background.Dark),
771 },
772 LinkText: ansi.StylePrimitive{
773 Color: stringPtr("#ff79c6"),
774 BackgroundColor: stringPtr(Background.Dark),
775 },
776 Image: ansi.StylePrimitive{
777 Color: stringPtr("#8be9fd"),
778 Underline: boolPtr(true),
779 BackgroundColor: stringPtr(Background.Dark),
780 },
781 ImageText: ansi.StylePrimitive{
782 Color: stringPtr("#ff79c6"),
783 Format: "Image: {{.text}} ā",
784 BackgroundColor: stringPtr(Background.Dark),
785 },
786 Code: ansi.StyleBlock{
787 StylePrimitive: ansi.StylePrimitive{
788 Color: stringPtr("#50fa7b"),
789 BackgroundColor: stringPtr(Background.Dark),
790 },
791 },
792 Text: ansi.StylePrimitive{
793 BackgroundColor: stringPtr(Background.Dark),
794 },
795 DefinitionList: ansi.StyleBlock{},
796 CodeBlock: ansi.StyleCodeBlock{
797 StyleBlock: ansi.StyleBlock{
798 StylePrimitive: ansi.StylePrimitive{
799 Color: stringPtr("#ffb86c"),
800 BackgroundColor: stringPtr(Background.Dark),
801 },
802 Margin: uintPtr(defaultMargin),
803 },
804 Chroma: &ansi.Chroma{
805 NameOther: ansi.StylePrimitive{
806 BackgroundColor: stringPtr(Background.Dark),
807 },
808 Literal: ansi.StylePrimitive{
809 BackgroundColor: stringPtr(Background.Dark),
810 },
811 NameException: ansi.StylePrimitive{
812 BackgroundColor: stringPtr(Background.Dark),
813 },
814 LiteralDate: ansi.StylePrimitive{
815 BackgroundColor: stringPtr(Background.Dark),
816 },
817 Text: ansi.StylePrimitive{
818 Color: stringPtr(Forground.Dark),
819 BackgroundColor: stringPtr(Background.Dark),
820 },
821 Error: ansi.StylePrimitive{
822 Color: stringPtr("#f8f8f2"),
823 BackgroundColor: stringPtr("#ff5555"),
824 },
825 Comment: ansi.StylePrimitive{
826 Color: stringPtr("#6272A4"),
827 BackgroundColor: stringPtr(Background.Dark),
828 },
829 CommentPreproc: ansi.StylePrimitive{
830 Color: stringPtr("#ff79c6"),
831 BackgroundColor: stringPtr(Background.Dark),
832 },
833 Keyword: ansi.StylePrimitive{
834 Color: stringPtr("#ff79c6"),
835 BackgroundColor: stringPtr(Background.Dark),
836 },
837 KeywordReserved: ansi.StylePrimitive{
838 Color: stringPtr("#ff79c6"),
839 BackgroundColor: stringPtr(Background.Dark),
840 },
841 KeywordNamespace: ansi.StylePrimitive{
842 Color: stringPtr("#ff79c6"),
843 BackgroundColor: stringPtr(Background.Dark),
844 },
845 KeywordType: ansi.StylePrimitive{
846 Color: stringPtr("#8be9fd"),
847 BackgroundColor: stringPtr(Background.Dark),
848 },
849 Operator: ansi.StylePrimitive{
850 Color: stringPtr("#ff79c6"),
851 BackgroundColor: stringPtr(Background.Dark),
852 },
853 Punctuation: ansi.StylePrimitive{
854 Color: stringPtr(Forground.Dark),
855 BackgroundColor: stringPtr(Background.Dark),
856 },
857 Name: ansi.StylePrimitive{
858 Color: stringPtr("#8be9fd"),
859 BackgroundColor: stringPtr(Background.Dark),
860 },
861 NameBuiltin: ansi.StylePrimitive{
862 Color: stringPtr("#8be9fd"),
863 BackgroundColor: stringPtr(Background.Dark),
864 },
865 NameTag: ansi.StylePrimitive{
866 Color: stringPtr("#ff79c6"),
867 BackgroundColor: stringPtr(Background.Dark),
868 },
869 NameAttribute: ansi.StylePrimitive{
870 Color: stringPtr("#50fa7b"),
871 BackgroundColor: stringPtr(Background.Dark),
872 },
873 NameClass: ansi.StylePrimitive{
874 Color: stringPtr("#8be9fd"),
875 BackgroundColor: stringPtr(Background.Dark),
876 },
877 NameConstant: ansi.StylePrimitive{
878 Color: stringPtr("#bd93f9"),
879 BackgroundColor: stringPtr(Background.Dark),
880 },
881 NameDecorator: ansi.StylePrimitive{
882 Color: stringPtr("#50fa7b"),
883 BackgroundColor: stringPtr(Background.Dark),
884 },
885 NameFunction: ansi.StylePrimitive{
886 Color: stringPtr("#50fa7b"),
887 BackgroundColor: stringPtr(Background.Dark),
888 },
889 LiteralNumber: ansi.StylePrimitive{
890 Color: stringPtr("#6EEFC0"),
891 BackgroundColor: stringPtr(Background.Dark),
892 },
893 LiteralString: ansi.StylePrimitive{
894 Color: stringPtr("#f1fa8c"),
895 BackgroundColor: stringPtr(Background.Dark),
896 },
897 LiteralStringEscape: ansi.StylePrimitive{
898 Color: stringPtr("#ff79c6"),
899 BackgroundColor: stringPtr(Background.Dark),
900 },
901 GenericDeleted: ansi.StylePrimitive{
902 Color: stringPtr("#ff5555"),
903 BackgroundColor: stringPtr(Background.Dark),
904 },
905 GenericEmph: ansi.StylePrimitive{
906 Color: stringPtr("#f1fa8c"),
907 Italic: boolPtr(true),
908 BackgroundColor: stringPtr(Background.Dark),
909 },
910 GenericInserted: ansi.StylePrimitive{
911 Color: stringPtr("#50fa7b"),
912 BackgroundColor: stringPtr(Background.Dark),
913 },
914 GenericStrong: ansi.StylePrimitive{
915 Color: stringPtr("#ffb86c"),
916 Bold: boolPtr(true),
917 BackgroundColor: stringPtr(Background.Dark),
918 },
919 GenericSubheading: ansi.StylePrimitive{
920 Color: stringPtr("#bd93f9"),
921 BackgroundColor: stringPtr(Background.Dark),
922 },
923 Background: ansi.StylePrimitive{
924 BackgroundColor: stringPtr(Background.Dark),
925 },
926 },
927 },
928 Table: ansi.StyleTable{
929 StyleBlock: ansi.StyleBlock{
930 StylePrimitive: ansi.StylePrimitive{
931 BackgroundColor: stringPtr(Background.Dark),
932 },
933 IndentToken: stringPtr(BaseStyle.Render(" ")),
934 },
935 },
936 DefinitionDescription: ansi.StylePrimitive{
937 BlockPrefix: "\n* ",
938 BackgroundColor: stringPtr(Background.Dark),
939 },
940}