anchor.diff:                ([A,B,C,D]) ->
                     fmt("['~s','~s','~s','~s']", [html_encode(X) || X <- [A,B,C,D]])
             end,
  -          lists:sort(fun sort_index/2, lists:map(F, FIndex))),
  +          Sorted),
   
       Js = fmt("var index = [~s];",
                [string:join([[C || C <- I, C /= $\n, C /= $\r] || I <- Index], ",")]),
   
       ok = file:write_file(jname(kf(dest,Conf), "erldocs_index.js"), Js).
  +
  +shorten (Str) ->
  +    string:substr(Str, 1, 50).
   
   %% Note: handles both erlref and cref types
   render (App, Mod, Xml, Types, Conf) ->
  
positive.code:         Pos ->
              {Name2, Rest2} = lists:split(Pos-1, Tmp),
              Name3          = lists:last(string:tokens(Name2, ":")),
              Args           = string:substr(Rest2, 2, string:chr(Rest2, 41)-2),
              NArgs          = length(string:tokens(Args, ",")),
              Name3 ++ "/" ++ integer_to_list(NArgs)
      end.
  
  app_dirs (Paths) ->
      Fun = fun (Path, Acc) ->
                    Acc ++ [X || X <- filelib:wildcard(Path), filelib:is_dir(X)]
            end,
      lists:foldl(Fun, [], Paths).
  
  'add .html' ("#"++Rest) ->
      "#"++ separate_f_from_a(Rest);
  
negative.code:     %% Output XML files to destination folder
      %% This prevents from polluting the source files
      TmpRoot = jname(kf(dest,Conf), ?ERLDOCS_SPECS_TMP),
      XMLDir  = jname(TmpRoot, bname(AppDir)),
      filelib:ensure_dir(XMLDir ++ "/"),
  
      lists:foreach(fun (File) -> gen_type_specs(TmpRoot, IncludePaths, File) end, ErlFiles),
  