(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 1e2f1dea7e
commit b7bfdbf62f
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++ { for field := 3; field < len(decryptedEntry); field++ {
markdownNotes = append(markdownNotes, 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")) markdownNotesString, _ := r.Render(strings.Join(markdownNotes, "\n"))
// print markdown-rendered notes // print markdown-rendered notes
+8 -10
View File
@@ -2,19 +2,18 @@ package cli
import "strings" import "strings"
func glamourStyle(styleName string) []byte { func glamourStyle() []byte {
quarterHRString := strings.Repeat("─", width/4) quarterHRString := strings.Repeat("─", width/4)
return []byte(`{ return []byte(`{
"document": { "document": {
"color": "#EBDBB2",
"block_prefix": "\n", "block_prefix": "\n",
"block_suffix": "\n", "block_suffix": "\n"
"color": "#EBDBB2",
"margin": 0
}, },
"block_quote": { "block_quote": {
"indent": 2, "color": "#A89984",
"indent_token": "│ ", "indent": 4,
"color": "109" "indent_token": ""
}, },
"paragraph": {}, "paragraph": {},
"list": { "list": {
@@ -97,13 +96,12 @@ func glamourStyle(styleName string) []byte {
"code": { "code": {
"prefix": "", "prefix": "",
"suffix": "", "suffix": "",
"color": "203", "color": "#FB4934",
"background_color": "236" "background_color": "#3C3836"
}, },
"code_block": { "code_block": {
"block_prefix": "` + quarterHRString + "code" + quarterHRString + "\\n" + `", "block_prefix": "` + quarterHRString + "code" + quarterHRString + "\\n" + `",
"block_suffix": "` + strings.Repeat(quarterHRString, 2) + "────\\n" + `", "block_suffix": "` + strings.Repeat(quarterHRString, 2) + "────\\n" + `",
"color": "248",
"chroma": { "chroma": {
"text": { "text": {
"color": "#A89984" "color": "#A89984"