Add tag for building without Markdown support

This commit is contained in:
2024-07-16 15:30:48 -04:00
parent 66e9511eec
commit c6734dd283
4 changed files with 39 additions and 10 deletions
+18
View File
@@ -0,0 +1,18 @@
//go:build !noMarkdown
package cli
import (
"fmt"
"github.com/charmbracelet/glamour"
)
// renderNote renders the notes section of an entry (in Markdown) to stdout
func renderNote(note *string) {
r, _ := glamour.NewTermRenderer(glamour.WithStylesFromJSONBytes(glamourStyle()), glamour.WithPreservedNewLines(), glamour.WithWordWrap(width))
markdownNotesString, _ := r.Render(*note)
// print markdown-rendered notes
fmt.Print(markdownNotesString)
}