clj version of boot.new.templates. Originally derived from leiningen.new.templates but modified to have no Boot or Leiningen deps.
clj version of boot.new.templates. Originally derived from leiningen.new.templates but modified to have no Boot or Leiningen deps.
(->files {:keys [name] :as data} & paths)
Generate a file with content. path can be a java.io.File or string. It will be turned into a File regardless. Any parent directories will be created automatically. Data should include a key for :name so that the project is created in the correct directory.
Generate a file with content. path can be a java.io.File or string. It will be turned into a File regardless. Any parent directories will be created automatically. Data should include a key for :name so that the project is created in the correct directory.
(date)
Get the current date as a string in ISO8601 format.
Get the current date as a string in ISO8601 format.
(fix-line-separators s)
Replace all \n with system specific line separators.
Replace all \n with system specific line separators.
(group-name s)
Returns group name from (a possibly unqualified) name:
my.long.group/myproj => my.long.group mygroup/myproj => mygroup myproj => nil
Returns group name from (a possibly unqualified) name: my.long.group/myproj => my.long.group mygroup/myproj => mygroup myproj => nil
(multi-segment s)
(multi-segment s final-segment)
Make a namespace multi-segmented by adding another segment if necessary. The additional segment defaults to "core".
Make a namespace multi-segmented by adding another segment if necessary. The additional segment defaults to "core".
(name-to-path s)
Constructs directory structure from fully qualified artifact name:
"foo-bar.baz" becomes "foo_bar/baz"
and so on. Uses platform-specific file separators.
Constructs directory structure from fully qualified artifact name: "foo-bar.baz" becomes "foo_bar/baz" and so on. Uses platform-specific file separators.
(project-name s)
Returns project name from (possibly group-qualified) name:
mygroup/myproj => myproj myproj => myproj
Returns project name from (possibly group-qualified) name: mygroup/myproj => myproj myproj => myproj
(raw-resourcer name)
Create a renderer function that looks for raw files in the right place given the name of your template.
Create a renderer function that looks for raw files in the right place given the name of your template.
(renderer name & [render-fn])
Create a renderer function that looks for mustache templates in the right place given the name of your template. If no data is passed, the file is simply slurped and the content returned unchanged.
render-fn - Optional rendering function that will be used in place of the default renderer. This allows rendering templates that contain tags that conflic with the Stencil renderer such as {{..}}.
Create a renderer function that looks for mustache templates in the right place given the name of your template. If no data is passed, the file is simply slurped and the content returned unchanged. render-fn - Optional rendering function that will be used in place of the default renderer. This allows rendering templates that contain tags that conflic with the Stencil renderer such as {{..}}.
(sanitize s)
Replace hyphens with underscores.
Replace hyphens with underscores.
(sanitize-ns s)
Returns project namespace name from (possibly group-qualified) project name:
mygroup/myproj => mygroup.myproj myproj => myproj mygroup/my_proj => mygroup.my-proj
Returns project namespace name from (possibly group-qualified) project name: mygroup/myproj => mygroup.myproj myproj => myproj mygroup/my_proj => mygroup.my-proj
(slurp-resource resource)
Reads the contents of a resource. Temporarily converts line endings in the resource to \n before converting them into system specific line separators using fix-line-separators.
Reads the contents of a resource. Temporarily converts line endings in the resource to \n before converting them into system specific line separators using fix-line-separators.
(slurp-to-lf r)
Returns the entire contents of the given reader as a single string. Converts all line endings to \n.
Returns the entire contents of the given reader as a single string. Converts all line endings to \n.
(year)
Get the current year. Useful for setting copyright years and such.
Get the current year. Useful for setting copyright years and such.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close