mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
examples munger allows any file extension.
This commit is contained in:
@@ -27,7 +27,7 @@ const exampleToken = "EXAMPLE"
|
||||
|
||||
const exampleLineStart = "<!-- BEGIN MUNGE: EXAMPLE"
|
||||
|
||||
var exampleMungeTagRE = regexp.MustCompile(beginMungeTag(fmt.Sprintf("%s %s", exampleToken, `(([^ ])*.(yaml|json))`)))
|
||||
var exampleMungeTagRE = regexp.MustCompile(beginMungeTag(fmt.Sprintf("%s %s", exampleToken, `(([^ ])*[.]([^.]*))`)))
|
||||
|
||||
// syncExamples updates all examples in markdown file.
|
||||
//
|
||||
@@ -77,7 +77,14 @@ func syncExamples(filePath string, mlines mungeLines) (mungeLines, error) {
|
||||
}
|
||||
// update all example Tags
|
||||
for _, tag := range exampleTags {
|
||||
example, err := exampleContent(filePath, tag.linkText, tag.fileType)
|
||||
ft := ""
|
||||
if tag.fileType == "json" {
|
||||
ft = "json"
|
||||
}
|
||||
if tag.fileType == "yaml" {
|
||||
ft = "yaml"
|
||||
}
|
||||
example, err := exampleContent(filePath, tag.linkText, ft)
|
||||
if err != nil {
|
||||
return mlines, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user