mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-28 04:46:41 -04:00
(Markdown) Improve consistency of in-line code and block quote colors (block quotes are currently busted)
This commit is contained in:
@@ -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
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user