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)
Return a group name that conforms to Maven/Clojars rules, i.e., it looks like a reverse-domain-name. We don't try to be very smart about it: if it has a dot in it, and the first segment is 2 or 3 characters, we assume it is OK; otherwise we'll prefix it with net.clojars.
Depending on feedback, we may adjust that heuristic.
Return a group name that conforms to Maven/Clojars rules, i.e., it looks like a reverse-domain-name. We don't try to be very smart about it: if it has a dot in it, and the first segment is 2 or 3 characters, we assume it is OK; otherwise we'll prefix it with net.clojars. Depending on feedback, we may adjust that heuristic.
(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".
We remove the leading prefix if it is a public open source repository since io.github etc adds very little benefit at the namespace level.
Make a namespace multi-segmented by adding another segment if necessary. The additional segment defaults to "core". We remove the leading prefix if it is a public open source repository since io.github etc adds very little benefit at the namespace level.
(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-data name)
Return a standard packet of substitution data for use in a template.
Return a standard packet of substitution data for use in a template.
(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-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
(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
(scm-domain s)
Returns the SCM domain from the project name. We currently assume github.com if the project name has either io.github or com.github in it; similarly for gitlab.com. Additional SCM hosts may be supported in the future.
Returns the SCM domain from the project name. We currently assume github.com if the project name has either io.github or com.github in it; similarly for gitlab.com. Additional SCM hosts may be supported in the future.
(scm-user s)
Returns the SCM username from the project name.
Returns the SCM username from the project name.
(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