Liking cljdoc? Tell your friends :D

clj.new.templates

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.
raw docstring

*dir*clj

source

*environment*clj

source

*force?*clj

source

*overwrite?*clj

source

->filesclj

(->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.
sourceraw docstring

dateclj

(date)

Get the current date as a string in ISO8601 format.

Get the current date as a string in ISO8601 format.
sourceraw docstring

fix-line-separatorsclj

(fix-line-separators s)

Replace all \n with system specific line separators.

Replace all \n with system specific line separators.
sourceraw docstring

group-nameclj

(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.
sourceraw docstring

multi-segmentclj

(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.
sourceraw docstring

name-to-pathclj

(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.
sourceraw docstring

project-dataclj

(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.
sourceraw docstring

project-nameclj

(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
sourceraw docstring

raw-group-nameclj

(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
sourceraw docstring

raw-resourcerclj

(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.
sourceraw docstring

render-textclj

(render-text & args)
source

rendererclj

(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 {{..}}.
sourceraw docstring

sanitizeclj

(sanitize s)

Replace hyphens with underscores.

Replace hyphens with underscores.
sourceraw docstring

sanitize-nsclj

(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
sourceraw docstring

scm-domainclj

(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.
sourceraw docstring

scm-userclj

(scm-user s)

Returns the SCM username from the project name.

Returns the SCM username from the project name.
sourceraw docstring

slurp-resourceclj

(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.
sourceraw docstring

slurp-to-lfclj

(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.
sourceraw docstring

yearclj

(year)

Get the current year. Useful for setting copyright years and such.

Get the current year. Useful for setting copyright years and such.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close