anchor.diff:              true
       end.
   
  -build_apps (Conf, IncludePaths, AppDir, Index) ->
  -    AppName = bname(AppDir),
  +build_apps (Conf, IncludePaths, AppName, AppDir, Index) ->
       ?log("Building ~s", [AppName]),
  -    Files   = ensure_docsrc(Conf, IncludePaths, AppDir),
  -    Map = fun (F) -> build_file_map(Conf, AppName, F) end,
  -    [["app", AppName, AppName, "[application]"] |
  -     pmapreduce(Map, fun lists:append/2, [], Files) ++ Index].
  -
  -build_file_map (Conf, AppName, File) ->
  -    Module = bname(File, ".xml"),
  +    Files = ensure_docsrc(Conf, IncludePaths, AppName, AppDir),
  +    Map = fun (File) -> build_file_map(Conf, AppName, bname(File,".xml"), File) end,
  +    [ ["app", AppName, AppName, "[application]"]
  +      | pmapreduce(Map, fun lists:append/2, [], Files)
  +      ++ Index
  +    ].
  +
  +build_file_map (Conf, AppName, Module, File) ->
       case is_ignored(AppName, Module) of
           true ->
               ?log("HTML generation for ~s skipped - ~p", [Module, File]),
               [];
           false ->
  -            ?log("Generating HTML - ~s ~p", [Module, File]),
               {Type, _Attr, Content} = read_xml(File),
  -
               case is_buildable(Type) of
                   false ->
                       ?log("HTML generation for ~s impossible - ~p", [Module, File]),
                       [];
                   true ->
  -                    TypeSpecsFile = jname([kf(dest,Conf), ?ERLDOCS_SPECS_TMP, "specs_"++Module++".xml"]),
  -                    case filelib:is_file(TypeSpecsFile) of
  -                        false ->                      TypeSpecs = [];
  -                        true ->
  -                            case read_xml(TypeSpecsFile) of
  -                                {error, _, _} ->      TypeSpecs = [];
  -                                {module, _, Specs} -> TypeSpecs = strip_whitespace(Specs)
  -                            end
  -                    end,
  -
  +                    ?log("Generating HTML - ~s ~p", [Module, File]),
                       Xml = strip_whitespace(Content),
  -
  -                    %% strip silly shy characters
                       Funs = get_funs(AppName, Module, lists:keyfind(funcs, 1, Xml)),
  -
  +                    TypeSpecs = read_xml_specs(Conf, Module),
                       ok = render(AppName, Module, Content, TypeSpecs, Conf),
  -
                       Sum = lists:flatten(module_summary(Type, Xml)),
                       [ ["mod", AppName, Module, Sum] | Funs]
               end
  
positive.code:            , {layout, docgen_edoc_xml_cb}
             ],
  
      AppName = bname(AppDir),
      ?log("Generating XML for application ~s ~p -> ~p", [AppName,AppDir,Dest]),
      case catch (edoc:application(list_to_atom(AppName), AppDir, Opts)) of
          ok ->
  
negative.code:     {_, [], Sum} = lists:keyfind(libsummary, 1, Xml),
      Sum.
  
  ensure_docsrc (Conf, IncludePaths, AppName, AppDir) ->
      %% List any doc/src/*.xml files that exist in the source files
      XMLFiles = filelib:wildcard(jname([AppDir, "doc", "src", "*.xml"])),
      HandWritten = [bname(File, ".xml") || File <- XMLFiles],
  
      ErlFiles = filelib:wildcard(jname( AppDir,        "*.erl" ))
          ++     filelib:wildcard(jname([AppDir, "src", "*.erl"]))
          ++ maybe_add_otp_preloaded(AppName, kf(building_otp,Conf)),
  
      %% Generate any missing module XML
      SrcFiles = [filename:absname(File) ||
  