   @doc """
   Compiles the given EEx string.
   """
-  @spec compile_string(binary(), Template.template_type()) ::
+  @spec compile_string(binary(), options()) ::
           {:ok, Macro.t()}
-          | {:ct_error, binary, integer}
-  def compile_string(data, kind) do
-    compiled = EEx.compile_string(data)
+          | {:ct_error, binary(), integer()}
+  def compile_string(string, options) do
+    compiled = EEx.compile_string(string)
+    includes = options[:includes] || []
 
     ast =
-      case kind do
-        :template -> Macro.postwalk(compiled, &expand_includes/1)
+      case options[:type] do
         :include -> compiled
+        _ -> Macro.postwalk(compiled, &expand_includes(&1, includes))
       end
 
     {:ok, ast}

    end
  end

  defp expand_includes(anything_else), do: anything_else
end

      {:ct_error, e.description, e.line}
  end

  @spec expand_includes(Macro.t(), map()) :: Macro.t()
  defp expand_includes(ast, includes)

  defp expand_includes({:include, _, [arg]}, includes) do
    case includes[arg] do
      nil ->
        warn("There is no includable template named `#{arg}`.")
        nil
