Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CAMEL_CASE_REGEX = regexp.MustCompile( "(^([[:lower:]]|[[:digit:]])+)|" + "([[:upper:]]*([[:lower:]]|[[:digit:]]|$)*)") // Handle normal camel case
This regex can be used to split CamelCase strings into "words". That is, given a string like FooBarBaz, you can use this regex to split it into an array ["Foo", "Bar", "Baz"]. It also handles lower camel case, which is the same as camel case, except it starts with a lower case word, such as fooBarBaz.
To capture lowercase camel case, we just look for words that consist of lower case letters and digits at the start of the string. To capture all other camel case, we look for "words" that start with one or more consecutive upper case letters followed by one or more lower case letters or digits.
var PUNCTUATION_OR_WHITESPACE_REGEX = regexp.MustCompile("([[:space:]]|[[:punct:]])+")
var SNIPPET_MARKER_REGEX = regexp.MustCompile("boilerplate-snippet:\\s*(.+?)(?:\\s|$)")
var WHITESPACE_REGEX = regexp.MustCompile("[[:space:]]+")
Functions ¶
func CreateTemplateHelpers ¶
Create a map of custom template helpers exposed by boilerplate
func ProcessTemplate ¶ added in v0.0.6
func ProcessTemplate(options *config.BoilerplateOptions) error
Process the boilerplate template specified in the given options and use the existing variables. This function will load any missing variables (either from command line options or by prompting the user), execute all the dependent boilerplate templates, and then execute this template.
Types ¶
type InvalidSnippetArguments ¶
type InvalidSnippetArguments []string
func (InvalidSnippetArguments) Error ¶
func (args InvalidSnippetArguments) Error() string
type SnippetNotFound ¶
type SnippetNotFound string
func (SnippetNotFound) Error ¶
func (snippetName SnippetNotFound) Error() string
type SnippetNotTerminated ¶
type SnippetNotTerminated string
func (SnippetNotTerminated) Error ¶
func (snippetName SnippetNotTerminated) Error() string