dockerize v0.1.1 Dockerize.Template
模板相关 helper 方法
Link to this section Summary
Link to this section Functions
Link to this function
generate_from_template(template, opts)
Link to this function
generate_from_templates(templates, opts)
Link to this function
input_path(file, opts \\ [])
获取模板文件对应的实际路径。有两种策略:
- 在 dockerize 项目开发时,使用 "./template"
- 在作为 hex 依赖时,使用 "./deps/dockerize/template"
Example
iex> Dockerize.Template.input_path("a", base: "") "priv/template/a.eex"
iex> Dockerize.Template.input_path("x/y.html", base: "") "priv/template/x/y.html.eex"
iex> Dockerize.Template.input_path("foo", base: "bar") "bar/priv/template/foo.eex"
iex> Dockerize.Template.inputpath(".foo", base: "bar") "bar/priv/template/.foo.eex"
Link to this function
output_path(file, opts \\ [])
获取模板文件对应输出路径
Example
iex> Dockerize.Template.output_path("a", base: "") "a"
iex> Dockerize.Template.output_path("x/y.html", base: "") "x/y.html"
iex> Dockerize.Template.output_path("foo", base: "bar") "foo"
iex> Dockerize.Template.output_path("foo", base: "bar", output: "baz") "baz/foo"