diff --git a/README.md b/README.md index fc8d4bb..24ed6f9 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,30 @@ regex = '''(?i)([A-Za-z0-9!#$%&'*+\/=?^_{|.}~-]+@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9 tags = ["email", "User Info"] ``` +### Custom Templates + +Pillager allows you to use powerful `go text/template` to customize the output format. Here are a few template examples. + +#### Basic +```gotemplate +{{/*basic.tmpl*/}} +{{ range .Leaks}} + Leak: {{.Line}} + Line: {{.LineNumber}} + File: {{ .File }} +{{end}} +``` + +#### Markdown Styling +```gotemplate +{{/*markdown.tmpl*/}} +# Results +{{ range .Leaks}} + ## {{ .File }} + - Location: {{.LineNumber}} +{{end}} +``` + ## Documentation :books: [View the docs](hunter) diff --git a/templates/markdown.tmpl b/templates/markdown.tmpl new file mode 100644 index 0000000..9b9757f --- /dev/null +++ b/templates/markdown.tmpl @@ -0,0 +1,6 @@ +{{/*markdown.tmpl*/}} +# Results +{{ range .Leaks}} + ## {{ .File }} + - Location: {{.LineNumber}} +{{end}}