mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 00:47:15 -04:00
Remove blackfriday requirement from clients
This commit is contained in:
@@ -209,6 +209,18 @@ func NewElement(node *bf.Node) Element {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Render(in string, stylePath string) ([]byte, error) {
|
||||||
|
return RenderBytes([]byte(in), stylePath)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RenderBytes(in []byte, stylePath string) ([]byte, error) {
|
||||||
|
r, err := NewTermRenderer(stylePath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return bf.Run(in, bf.WithRenderer(r)), nil
|
||||||
|
}
|
||||||
|
|
||||||
func NewTermRenderer(stylePath string) (*TermRenderer, error) {
|
func NewTermRenderer(stylePath string) (*TermRenderer, error) {
|
||||||
if stylePath == "" {
|
if stylePath == "" {
|
||||||
return NewTermRendererFromBytes([]byte("{}"))
|
return NewTermRendererFromBytes([]byte("{}"))
|
||||||
|
|||||||
Reference in New Issue
Block a user