| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941 |
- package styles
- import (
- "github.com/charmbracelet/glamour/ansi"
- "github.com/charmbracelet/lipgloss"
- )
- const defaultMargin = 1
- // Helper functions for style pointers
- func boolPtr(b bool) *bool { return &b }
- func stringPtr(s string) *string { return &s }
- func uintPtr(u uint) *uint { return &u }
- // CatppuccinMarkdownStyle is the Catppuccin Mocha style for Glamour markdown rendering.
- func CatppuccinMarkdownStyle() ansi.StyleConfig {
- isDark := lipgloss.HasDarkBackground()
- if isDark {
- return catppuccinDark
- }
- return catppuccinLight
- }
- var catppuccinDark = ansi.StyleConfig{
- Document: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BlockPrefix: "\n",
- BlockSuffix: "",
- Color: stringPtr(dark.Text().Hex),
- },
- Margin: uintPtr(defaultMargin),
- },
- BlockQuote: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr(dark.Yellow().Hex),
- Italic: boolPtr(true),
- Prefix: "┃ ",
- },
- Indent: uintPtr(1),
- IndentToken: stringPtr(BaseStyle.Render(" ")),
- },
- List: ansi.StyleList{
- LevelIndent: defaultMargin,
- StyleBlock: ansi.StyleBlock{
- IndentToken: stringPtr(BaseStyle.Render(" ")),
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr(dark.Text().Hex),
- },
- },
- },
- Heading: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BlockSuffix: "\n",
- Color: stringPtr(dark.Mauve().Hex),
- Bold: boolPtr(true),
- },
- },
- H1: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "# ",
- Color: stringPtr(dark.Lavender().Hex),
- Bold: boolPtr(true),
- BlockPrefix: "\n",
- },
- },
- H2: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "## ",
- Color: stringPtr(dark.Mauve().Hex),
- Bold: boolPtr(true),
- },
- },
- H3: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "### ",
- Color: stringPtr(dark.Pink().Hex),
- Bold: boolPtr(true),
- },
- },
- H4: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "#### ",
- Color: stringPtr(dark.Flamingo().Hex),
- Bold: boolPtr(true),
- },
- },
- H5: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "##### ",
- Color: stringPtr(dark.Rosewater().Hex),
- Bold: boolPtr(true),
- },
- },
- H6: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "###### ",
- Color: stringPtr(dark.Rosewater().Hex),
- Bold: boolPtr(true),
- },
- },
- Strikethrough: ansi.StylePrimitive{
- CrossedOut: boolPtr(true),
- Color: stringPtr(dark.Overlay1().Hex),
- },
- Emph: ansi.StylePrimitive{
- Color: stringPtr(dark.Yellow().Hex),
- Italic: boolPtr(true),
- },
- Strong: ansi.StylePrimitive{
- Bold: boolPtr(true),
- Color: stringPtr(dark.Peach().Hex),
- },
- HorizontalRule: ansi.StylePrimitive{
- Color: stringPtr(dark.Overlay0().Hex),
- Format: "\n─────────────────────────────────────────\n",
- },
- Item: ansi.StylePrimitive{
- BlockPrefix: "• ",
- Color: stringPtr(dark.Blue().Hex),
- },
- Enumeration: ansi.StylePrimitive{
- BlockPrefix: ". ",
- Color: stringPtr(dark.Sky().Hex),
- },
- Task: ansi.StyleTask{
- StylePrimitive: ansi.StylePrimitive{},
- Ticked: "[✓] ",
- Unticked: "[ ] ",
- },
- Link: ansi.StylePrimitive{
- Color: stringPtr(dark.Sky().Hex),
- Underline: boolPtr(true),
- },
- LinkText: ansi.StylePrimitive{
- Color: stringPtr(dark.Pink().Hex),
- Bold: boolPtr(true),
- },
- Image: ansi.StylePrimitive{
- Color: stringPtr(dark.Sapphire().Hex),
- Underline: boolPtr(true),
- Format: "🖼 {{.text}}",
- },
- ImageText: ansi.StylePrimitive{
- Color: stringPtr(dark.Pink().Hex),
- Format: "{{.text}}",
- },
- Code: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr(dark.Green().Hex),
- Prefix: "",
- Suffix: "",
- },
- },
- CodeBlock: ansi.StyleCodeBlock{
- StyleBlock: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: " ",
- Color: stringPtr(dark.Text().Hex),
- },
- Margin: uintPtr(defaultMargin),
- },
- Chroma: &ansi.Chroma{
- Text: ansi.StylePrimitive{
- Color: stringPtr(dark.Text().Hex),
- },
- Error: ansi.StylePrimitive{
- Color: stringPtr(dark.Text().Hex),
- },
- Comment: ansi.StylePrimitive{
- Color: stringPtr(dark.Overlay1().Hex),
- },
- CommentPreproc: ansi.StylePrimitive{
- Color: stringPtr(dark.Pink().Hex),
- },
- Keyword: ansi.StylePrimitive{
- Color: stringPtr(dark.Pink().Hex),
- },
- KeywordReserved: ansi.StylePrimitive{
- Color: stringPtr(dark.Pink().Hex),
- },
- KeywordNamespace: ansi.StylePrimitive{
- Color: stringPtr(dark.Pink().Hex),
- },
- KeywordType: ansi.StylePrimitive{
- Color: stringPtr(dark.Sky().Hex),
- },
- Operator: ansi.StylePrimitive{
- Color: stringPtr(dark.Pink().Hex),
- },
- Punctuation: ansi.StylePrimitive{
- Color: stringPtr(dark.Text().Hex),
- },
- Name: ansi.StylePrimitive{
- Color: stringPtr(dark.Sky().Hex),
- },
- NameBuiltin: ansi.StylePrimitive{
- Color: stringPtr(dark.Sky().Hex),
- },
- NameTag: ansi.StylePrimitive{
- Color: stringPtr(dark.Pink().Hex),
- },
- NameAttribute: ansi.StylePrimitive{
- Color: stringPtr(dark.Green().Hex),
- },
- NameClass: ansi.StylePrimitive{
- Color: stringPtr(dark.Sky().Hex),
- },
- NameConstant: ansi.StylePrimitive{
- Color: stringPtr(dark.Mauve().Hex),
- },
- NameDecorator: ansi.StylePrimitive{
- Color: stringPtr(dark.Green().Hex),
- },
- NameFunction: ansi.StylePrimitive{
- Color: stringPtr(dark.Green().Hex),
- },
- LiteralNumber: ansi.StylePrimitive{
- Color: stringPtr(dark.Teal().Hex),
- },
- LiteralString: ansi.StylePrimitive{
- Color: stringPtr(dark.Yellow().Hex),
- },
- LiteralStringEscape: ansi.StylePrimitive{
- Color: stringPtr(dark.Pink().Hex),
- },
- GenericDeleted: ansi.StylePrimitive{
- Color: stringPtr(dark.Red().Hex),
- },
- GenericEmph: ansi.StylePrimitive{
- Color: stringPtr(dark.Yellow().Hex),
- Italic: boolPtr(true),
- },
- GenericInserted: ansi.StylePrimitive{
- Color: stringPtr(dark.Green().Hex),
- },
- GenericStrong: ansi.StylePrimitive{
- Color: stringPtr(dark.Peach().Hex),
- Bold: boolPtr(true),
- },
- GenericSubheading: ansi.StylePrimitive{
- Color: stringPtr(dark.Mauve().Hex),
- },
- },
- },
- Table: ansi.StyleTable{
- StyleBlock: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BlockPrefix: "\n",
- BlockSuffix: "\n",
- },
- },
- CenterSeparator: stringPtr("┼"),
- ColumnSeparator: stringPtr("│"),
- RowSeparator: stringPtr("─"),
- },
- DefinitionDescription: ansi.StylePrimitive{
- BlockPrefix: "\n ❯ ",
- Color: stringPtr(dark.Sapphire().Hex),
- },
- }
- var catppuccinLight = ansi.StyleConfig{
- Document: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BlockPrefix: "\n",
- BlockSuffix: "\n",
- Color: stringPtr(light.Text().Hex),
- },
- Margin: uintPtr(defaultMargin),
- },
- BlockQuote: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr(light.Yellow().Hex),
- Italic: boolPtr(true),
- Prefix: "┃ ",
- },
- Indent: uintPtr(1),
- Margin: uintPtr(defaultMargin),
- },
- List: ansi.StyleList{
- LevelIndent: defaultMargin,
- StyleBlock: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr(light.Text().Hex),
- },
- },
- },
- Heading: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BlockSuffix: "\n",
- Color: stringPtr(light.Mauve().Hex),
- Bold: boolPtr(true),
- },
- },
- H1: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "# ",
- Color: stringPtr(light.Lavender().Hex),
- Bold: boolPtr(true),
- BlockPrefix: "\n",
- },
- },
- H2: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "## ",
- Color: stringPtr(light.Mauve().Hex),
- Bold: boolPtr(true),
- },
- },
- H3: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "### ",
- Color: stringPtr(light.Pink().Hex),
- Bold: boolPtr(true),
- },
- },
- H4: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "#### ",
- Color: stringPtr(light.Flamingo().Hex),
- Bold: boolPtr(true),
- },
- },
- H5: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "##### ",
- Color: stringPtr(light.Rosewater().Hex),
- Bold: boolPtr(true),
- },
- },
- H6: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "###### ",
- Color: stringPtr(light.Rosewater().Hex),
- Bold: boolPtr(true),
- },
- },
- Strikethrough: ansi.StylePrimitive{
- CrossedOut: boolPtr(true),
- Color: stringPtr(light.Overlay1().Hex),
- },
- Emph: ansi.StylePrimitive{
- Color: stringPtr(light.Yellow().Hex),
- Italic: boolPtr(true),
- },
- Strong: ansi.StylePrimitive{
- Bold: boolPtr(true),
- Color: stringPtr(light.Peach().Hex),
- },
- HorizontalRule: ansi.StylePrimitive{
- Color: stringPtr(light.Overlay0().Hex),
- Format: "\n─────────────────────────────────────────\n",
- },
- Item: ansi.StylePrimitive{
- BlockPrefix: "• ",
- Color: stringPtr(light.Blue().Hex),
- },
- Enumeration: ansi.StylePrimitive{
- BlockPrefix: ". ",
- Color: stringPtr(light.Sky().Hex),
- },
- Task: ansi.StyleTask{
- StylePrimitive: ansi.StylePrimitive{},
- Ticked: "[✓] ",
- Unticked: "[ ] ",
- },
- Link: ansi.StylePrimitive{
- Color: stringPtr(light.Sky().Hex),
- Underline: boolPtr(true),
- },
- LinkText: ansi.StylePrimitive{
- Color: stringPtr(light.Pink().Hex),
- Bold: boolPtr(true),
- },
- Image: ansi.StylePrimitive{
- Color: stringPtr(light.Sapphire().Hex),
- Underline: boolPtr(true),
- Format: "🖼 {{.text}}",
- },
- ImageText: ansi.StylePrimitive{
- Color: stringPtr(light.Pink().Hex),
- Format: "{{.text}}",
- },
- Code: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr(light.Green().Hex),
- Prefix: " ",
- Suffix: " ",
- },
- },
- CodeBlock: ansi.StyleCodeBlock{
- StyleBlock: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: " ",
- Color: stringPtr(light.Text().Hex),
- },
- Margin: uintPtr(defaultMargin),
- },
- Chroma: &ansi.Chroma{
- Text: ansi.StylePrimitive{
- Color: stringPtr(light.Text().Hex),
- },
- Error: ansi.StylePrimitive{
- Color: stringPtr(light.Text().Hex),
- },
- Comment: ansi.StylePrimitive{
- Color: stringPtr(light.Overlay1().Hex),
- },
- CommentPreproc: ansi.StylePrimitive{
- Color: stringPtr(light.Pink().Hex),
- },
- Keyword: ansi.StylePrimitive{
- Color: stringPtr(light.Pink().Hex),
- },
- KeywordReserved: ansi.StylePrimitive{
- Color: stringPtr(light.Pink().Hex),
- },
- KeywordNamespace: ansi.StylePrimitive{
- Color: stringPtr(light.Pink().Hex),
- },
- KeywordType: ansi.StylePrimitive{
- Color: stringPtr(light.Sky().Hex),
- },
- Operator: ansi.StylePrimitive{
- Color: stringPtr(light.Pink().Hex),
- },
- Punctuation: ansi.StylePrimitive{
- Color: stringPtr(light.Text().Hex),
- },
- Name: ansi.StylePrimitive{
- Color: stringPtr(light.Sky().Hex),
- },
- NameBuiltin: ansi.StylePrimitive{
- Color: stringPtr(light.Sky().Hex),
- },
- NameTag: ansi.StylePrimitive{
- Color: stringPtr(light.Pink().Hex),
- },
- NameAttribute: ansi.StylePrimitive{
- Color: stringPtr(light.Green().Hex),
- },
- NameClass: ansi.StylePrimitive{
- Color: stringPtr(light.Sky().Hex),
- },
- NameConstant: ansi.StylePrimitive{
- Color: stringPtr(light.Mauve().Hex),
- },
- NameDecorator: ansi.StylePrimitive{
- Color: stringPtr(light.Green().Hex),
- },
- NameFunction: ansi.StylePrimitive{
- Color: stringPtr(light.Green().Hex),
- },
- LiteralNumber: ansi.StylePrimitive{
- Color: stringPtr(light.Teal().Hex),
- },
- LiteralString: ansi.StylePrimitive{
- Color: stringPtr(light.Yellow().Hex),
- },
- LiteralStringEscape: ansi.StylePrimitive{
- Color: stringPtr(light.Pink().Hex),
- },
- GenericDeleted: ansi.StylePrimitive{
- Color: stringPtr(light.Red().Hex),
- },
- GenericEmph: ansi.StylePrimitive{
- Color: stringPtr(light.Yellow().Hex),
- Italic: boolPtr(true),
- },
- GenericInserted: ansi.StylePrimitive{
- Color: stringPtr(light.Green().Hex),
- },
- GenericStrong: ansi.StylePrimitive{
- Color: stringPtr(light.Peach().Hex),
- Bold: boolPtr(true),
- },
- GenericSubheading: ansi.StylePrimitive{
- Color: stringPtr(light.Mauve().Hex),
- },
- },
- },
- Table: ansi.StyleTable{
- StyleBlock: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BlockPrefix: "\n",
- BlockSuffix: "\n",
- },
- },
- CenterSeparator: stringPtr("┼"),
- ColumnSeparator: stringPtr("│"),
- RowSeparator: stringPtr("─"),
- },
- DefinitionDescription: ansi.StylePrimitive{
- BlockPrefix: "\n ❯ ",
- Color: stringPtr(light.Sapphire().Hex),
- },
- }
- func MarkdownTheme(focused bool) ansi.StyleConfig {
- if !focused {
- return ASCIIStyleConfig
- } else {
- return DraculaStyleConfig
- }
- }
- const (
- defaultListIndent = 2
- defaultListLevelIndent = 4
- )
- var ASCIIStyleConfig = ansi.StyleConfig{
- Document: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- Color: stringPtr(ForgroundDim.Dark),
- },
- Indent: uintPtr(1),
- IndentToken: stringPtr(BaseStyle.Render(" ")),
- },
- BlockQuote: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- Indent: uintPtr(1),
- IndentToken: stringPtr("| "),
- },
- Paragraph: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- List: ansi.StyleList{
- StyleBlock: ansi.StyleBlock{
- IndentToken: stringPtr(BaseStyle.Render(" ")),
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- LevelIndent: defaultListLevelIndent,
- },
- Heading: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- BlockSuffix: "\n",
- },
- },
- H1: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- Prefix: "# ",
- },
- },
- H2: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- Prefix: "## ",
- },
- },
- H3: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- Prefix: "### ",
- },
- },
- H4: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- Prefix: "#### ",
- },
- },
- H5: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- Prefix: "##### ",
- },
- },
- H6: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- Prefix: "###### ",
- },
- },
- Strikethrough: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- BlockPrefix: "~~",
- BlockSuffix: "~~",
- },
- Emph: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- BlockPrefix: "*",
- BlockSuffix: "*",
- },
- Strong: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- BlockPrefix: "**",
- BlockSuffix: "**",
- },
- HorizontalRule: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- Format: "\n--------\n",
- },
- Item: ansi.StylePrimitive{
- BlockPrefix: "• ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- Enumeration: ansi.StylePrimitive{
- BlockPrefix: ". ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- Task: ansi.StyleTask{
- Ticked: "[x] ",
- Unticked: "[ ] ",
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- ImageText: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- Format: "Image: {{.text}} →",
- },
- Code: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BlockPrefix: "`",
- BlockSuffix: "`",
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- CodeBlock: ansi.StyleCodeBlock{
- StyleBlock: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- Margin: uintPtr(defaultMargin),
- },
- },
- Table: ansi.StyleTable{
- StyleBlock: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- IndentToken: stringPtr(BaseStyle.Render(" ")),
- },
- CenterSeparator: stringPtr("|"),
- ColumnSeparator: stringPtr("|"),
- RowSeparator: stringPtr("-"),
- },
- DefinitionDescription: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- BlockPrefix: "\n* ",
- },
- }
- var DraculaStyleConfig = ansi.StyleConfig{
- Document: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr(Forground.Dark),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Indent: uintPtr(defaultMargin),
- IndentToken: stringPtr(BaseStyle.Render(" ")),
- },
- BlockQuote: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr("#f1fa8c"),
- Italic: boolPtr(true),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Indent: uintPtr(defaultMargin),
- IndentToken: stringPtr(BaseStyle.Render(" ")),
- },
- Paragraph: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- List: ansi.StyleList{
- LevelIndent: defaultMargin,
- StyleBlock: ansi.StyleBlock{
- IndentToken: stringPtr(BaseStyle.Render(" ")),
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr(Forground.Dark),
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- },
- Heading: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BlockSuffix: "\n",
- Color: stringPtr(PrimaryColor.Dark),
- Bold: boolPtr(true),
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- H1: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "# ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- H2: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "## ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- H3: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "### ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- H4: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "#### ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- H5: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "##### ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- H6: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Prefix: "###### ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- Strikethrough: ansi.StylePrimitive{
- CrossedOut: boolPtr(true),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Emph: ansi.StylePrimitive{
- Color: stringPtr("#f1fa8c"),
- Italic: boolPtr(true),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Strong: ansi.StylePrimitive{
- Bold: boolPtr(true),
- Color: stringPtr(Blue.Dark),
- BackgroundColor: stringPtr(Background.Dark),
- },
- HorizontalRule: ansi.StylePrimitive{
- Color: stringPtr("#6272A4"),
- Format: "\n--------\n",
- BackgroundColor: stringPtr(Background.Dark),
- },
- Item: ansi.StylePrimitive{
- BlockPrefix: "• ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- Enumeration: ansi.StylePrimitive{
- BlockPrefix: ". ",
- Color: stringPtr("#8be9fd"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Task: ansi.StyleTask{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- Ticked: "[✓] ",
- Unticked: "[ ] ",
- },
- Link: ansi.StylePrimitive{
- Color: stringPtr("#8be9fd"),
- Underline: boolPtr(true),
- BackgroundColor: stringPtr(Background.Dark),
- },
- LinkText: ansi.StylePrimitive{
- Color: stringPtr("#ff79c6"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Image: ansi.StylePrimitive{
- Color: stringPtr("#8be9fd"),
- Underline: boolPtr(true),
- BackgroundColor: stringPtr(Background.Dark),
- },
- ImageText: ansi.StylePrimitive{
- Color: stringPtr("#ff79c6"),
- Format: "Image: {{.text}} →",
- BackgroundColor: stringPtr(Background.Dark),
- },
- Code: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr("#50fa7b"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- Text: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- DefinitionList: ansi.StyleBlock{},
- CodeBlock: ansi.StyleCodeBlock{
- StyleBlock: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- Color: stringPtr(Blue.Dark),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Margin: uintPtr(defaultMargin),
- },
- Chroma: &ansi.Chroma{
- NameOther: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- Literal: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- NameException: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- LiteralDate: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- Text: ansi.StylePrimitive{
- Color: stringPtr(Forground.Dark),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Error: ansi.StylePrimitive{
- Color: stringPtr("#f8f8f2"),
- BackgroundColor: stringPtr("#ff5555"),
- },
- Comment: ansi.StylePrimitive{
- Color: stringPtr("#6272A4"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- CommentPreproc: ansi.StylePrimitive{
- Color: stringPtr("#ff79c6"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Keyword: ansi.StylePrimitive{
- Color: stringPtr("#ff79c6"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- KeywordReserved: ansi.StylePrimitive{
- Color: stringPtr("#ff79c6"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- KeywordNamespace: ansi.StylePrimitive{
- Color: stringPtr("#ff79c6"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- KeywordType: ansi.StylePrimitive{
- Color: stringPtr("#8be9fd"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Operator: ansi.StylePrimitive{
- Color: stringPtr("#ff79c6"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Punctuation: ansi.StylePrimitive{
- Color: stringPtr(Forground.Dark),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Name: ansi.StylePrimitive{
- Color: stringPtr("#8be9fd"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- NameBuiltin: ansi.StylePrimitive{
- Color: stringPtr("#8be9fd"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- NameTag: ansi.StylePrimitive{
- Color: stringPtr("#ff79c6"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- NameAttribute: ansi.StylePrimitive{
- Color: stringPtr("#50fa7b"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- NameClass: ansi.StylePrimitive{
- Color: stringPtr("#8be9fd"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- NameConstant: ansi.StylePrimitive{
- Color: stringPtr("#bd93f9"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- NameDecorator: ansi.StylePrimitive{
- Color: stringPtr("#50fa7b"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- NameFunction: ansi.StylePrimitive{
- Color: stringPtr("#50fa7b"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- LiteralNumber: ansi.StylePrimitive{
- Color: stringPtr("#6EEFC0"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- LiteralString: ansi.StylePrimitive{
- Color: stringPtr("#f1fa8c"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- LiteralStringEscape: ansi.StylePrimitive{
- Color: stringPtr("#ff79c6"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- GenericDeleted: ansi.StylePrimitive{
- Color: stringPtr("#ff5555"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- GenericEmph: ansi.StylePrimitive{
- Color: stringPtr("#f1fa8c"),
- Italic: boolPtr(true),
- BackgroundColor: stringPtr(Background.Dark),
- },
- GenericInserted: ansi.StylePrimitive{
- Color: stringPtr("#50fa7b"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- GenericStrong: ansi.StylePrimitive{
- Color: stringPtr("#ffb86c"),
- Bold: boolPtr(true),
- BackgroundColor: stringPtr(Background.Dark),
- },
- GenericSubheading: ansi.StylePrimitive{
- Color: stringPtr("#bd93f9"),
- BackgroundColor: stringPtr(Background.Dark),
- },
- Background: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- },
- },
- Table: ansi.StyleTable{
- StyleBlock: ansi.StyleBlock{
- StylePrimitive: ansi.StylePrimitive{
- BackgroundColor: stringPtr(Background.Dark),
- },
- IndentToken: stringPtr(BaseStyle.Render(" ")),
- },
- },
- DefinitionDescription: ansi.StylePrimitive{
- BlockPrefix: "\n* ",
- BackgroundColor: stringPtr(Background.Dark),
- },
- }
|