mark2web/pkg/filter/dump.go

13 lines
347 B
Go
Raw Normal View History

2019-03-18 13:34:52 +01:00
package filter
import (
"github.com/davecgh/go-spew/spew"
2022-02-28 11:43:47 +01:00
"github.com/flosch/pongo2/v4"
2019-03-18 13:34:52 +01:00
)
// DumpFilter is a pongo2 filter, which returns a spew.Dump of the input
func DumpFilter(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) {
dumpString := spew.Sdump(in.Interface())
return pongo2.AsValue(string(dumpString)), nil
}