examples munger allows any file extension.

This commit is contained in:
Eric Tune
2015-12-07 14:16:51 -08:00
parent ec1ba7438f
commit 21f81935e2
3 changed files with 16 additions and 2 deletions

View File

@@ -33,6 +33,8 @@ spec:
image: nginx
ports:
- containerPort: 80
`
var textExample = `some text
`
var cases = []struct {
in string
@@ -47,6 +49,10 @@ spec:
"<!-- BEGIN MUNGE: EXAMPLE ../mungedocs/testdata/pod.yaml -->\n<!-- END MUNGE: EXAMPLE ../mungedocs/testdata/pod.yaml -->\n",
"<!-- BEGIN MUNGE: EXAMPLE ../mungedocs/testdata/pod.yaml -->\n\n```yaml\n" + podExample + "```\n\n[Download example](../mungedocs/testdata/pod.yaml?raw=true)\n<!-- END MUNGE: EXAMPLE ../mungedocs/testdata/pod.yaml -->\n",
},
{
"<!-- BEGIN MUNGE: EXAMPLE testdata/example.txt -->\n<!-- END MUNGE: EXAMPLE testdata/example.txt -->\n",
"<!-- BEGIN MUNGE: EXAMPLE testdata/example.txt -->\n\n```\n" + textExample + "```\n\n[Download example](testdata/example.txt?raw=true)\n<!-- END MUNGE: EXAMPLE testdata/example.txt -->\n",
},
}
repoRoot = ""
for _, c := range cases {