mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-28 04:46:41 -04:00
19 lines
458 B
Go
19 lines
458 B
Go
//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)
|
|
}
|