MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / extractYamlFromMarkdownCodeBlock

Function extractYamlFromMarkdownCodeBlock

cli/cmd/init.go:164–173  ·  view source on GitHub ↗
(markdown string)

Source from the content-addressed store, hash-verified

162}
163
164func extractYamlFromMarkdownCodeBlock(markdown string) string {
165 re := regexp.MustCompile("```yaml.*?\n([\\s\\S]+?)\n```")
166
167 matches := re.FindStringSubmatch(markdown)
168 if len(matches) < 2 {
169 return ""
170 }
171
172 return matches[1]
173}
174
175func defaultConfigForPlugin(plugin cqapi.ListPlugin) *strings.Builder {
176 tmpl := `kind: {{.Kind}}

Callers 2

configForSourcePluginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected