Skip to content

Commit

Permalink
Updated readme to show the use of custom templates
Browse files Browse the repository at this point in the history
  • Loading branch information
brittonhayes committed Feb 7, 2021
1 parent 63a08a6 commit 2b35e86
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions templates/markdown.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{/*markdown.tmpl*/}}
# Results
{{ range .Leaks}}
## {{ .File }}
- Location: {{.LineNumber}}
{{end}}

0 comments on commit 2b35e86

Please sign in to comment.