(Markdown) Improve consistency of in-line code and block quote colors (block quotes are currently busted)

This commit is contained in:
2024-04-11 16:46:31 -04:00
parent 468a28a036
commit 426f91bda0
2 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ func EntryReader(decryptedEntry []string, hidePassword bool, sync bool) {
for field := 3; field < len(decryptedEntry); field++ {
markdownNotes = append(markdownNotes, decryptedEntry[field])
}
r, _ := glamour.NewTermRenderer(glamour.WithStylesFromJSONBytes(glamourStyle("gruvbox")), glamour.WithPreservedNewLines(), glamour.WithWordWrap(width))
r, _ := glamour.NewTermRenderer(glamour.WithStylesFromJSONBytes(glamourStyle()), glamour.WithPreservedNewLines(), glamour.WithWordWrap(width))
markdownNotesString, _ := r.Render(strings.Join(markdownNotes, "\n"))
// print markdown-rendered notes
+8 -10
View File
@@ -2,19 +2,18 @@ package cli
import "strings"
func glamourStyle(styleName string) []byte {
func glamourStyle() []byte {
quarterHRString := strings.Repeat("─", width/4)
return []byte(`{
"document": {
"color": "#EBDBB2",
"block_prefix": "\n",
"block_suffix": "\n",
"color": "#EBDBB2",
"margin": 0
"block_suffix": "\n"
},
"block_quote": {
"indent": 2,
"indent_token": "│ ",
"color": "109"
"color": "#A89984",
"indent": 4,
"indent_token": ""
},
"paragraph": {},
"list": {
@@ -97,13 +96,12 @@ func glamourStyle(styleName string) []byte {
"code": {
"prefix": "",
"suffix": "",
"color": "203",
"background_color": "236"
"color": "#FB4934",
"background_color": "#3C3836"
},
"code_block": {
"block_prefix": "` + quarterHRString + "code" + quarterHRString + "\\n" + `",
"block_suffix": "` + strings.Repeat(quarterHRString, 2) + "────\\n" + `",
"color": "248",
"chroma": {
"text": {
"color": "#A89984"