Skip to content
Browse files

put app names in index

  • Loading branch information...
1 parent c1fc238 commit 6a5e3edc46bfac80de32e974254ced118231d98f @etrepum etrepum committed Jul 18, 2010
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/erldocs.erl
View
13 src/erldocs.erl
@@ -133,7 +133,8 @@ module_index(Conf, Index) ->
log("Creating index.html ...~n"),
Html = "<h1>Module Index</h1><hr /><br /><div>"
- ++ xml_to_str([ mod(X) || X = ["mod"|_] <- lists:sort(Index)])
+ ++ lists:flatten(io_lib:format("<!--~n~p~n-->~n", [Index]))
+ ++ xml_to_str(emit_apps([X || X = ["mod"|_] <- lists:sort(Index)]))
++ "</div>",
Args = [{base, "./"},
@@ -144,6 +145,16 @@ module_index(Conf, Index) ->
ok = file:write_file([dest(Conf), "/index.html"],
file_tpl(Args, load_tpl(Conf))).
+emit_apps(L) ->
+ emit_apps(L, undefined).
+
+emit_apps([], _App) ->
+ [];
+emit_apps([X=["mod", App | _] | Rest], App) ->
+ [mod(X) | emit_apps(Rest, App)];
+emit_apps(L=[["mod", App | _] | _], _OtherApp) ->
+ [{h1, [], [App]} | emit_apps(L, App)].
+
mod(["mod", App, Mod, Sum]) ->
Url = App ++ "/" ++ Mod ++ ".html",
{p,[], [{a, [{href, Url}], [Mod]}, {br,[],[]}, Sum]}.

0 comments on commit 6a5e3ed

Please sign in to comment.
Something went wrong with that request. Please try again.