~mika/www.m1kadev.nl

ref: 434a746aed6b5f37146146e72e09e389d9e86a39 www.m1kadev.nl/kethel/lib/bricks.ex -rw-r--r-- 465 bytes
434a746a — m1kadev kethel: documentation changes, pull in node dependencies 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
defmodule Bricks do
  @typedoc "A path, relative to mix.exs"
  @type relative_path() :: binary()

  @typedoc "The name of the brick"
  @type brick_name() :: binary()

  @typedoc "A valid mustache template"
  @type mustache() :: binary()

  @spec collect(relative_path()) :: %{ brick_name() => mustache() }
  def collect(folder) do
    Path.wildcard(folder <> "/bricks/*.thtml")
      |> Map.new(fn x -> { FileX.trimmed_filename(x), File.read!(x) } end)
  end
 end