Skip to content

Commit

Permalink
remove double h1:s, stylesheet, image
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Wiger committed Sep 30, 2011
1 parent dbdd41e commit 66e54e6
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 96 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,6 @@




<h1>The edown application</h1> #The edown application#

The edown application
=====================


Status: Status:
------ ------
Expand Down
5 changes: 1 addition & 4 deletions doc/README.md
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,6 @@




<h1>The edown application</h1> #The edown application#

The edown application
=====================


Status: Status:
------ ------
Expand Down
5 changes: 1 addition & 4 deletions doc/edown_doclet.md
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,6 @@
Module edown_doclet
===================




<h1>Module edown_doclet</h1> #Module edown_doclet#

* [Description](#description) * [Description](#description)
* [Function Index](#index) * [Function Index](#index)
* [Function Details](#functions) * [Function Details](#functions)
Expand Down
5 changes: 1 addition & 4 deletions doc/edown_layout.md
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,6 @@
Module edown_layout
===================




<h1>Module edown_layout</h1> #Module edown_layout#

* [Description](#description) * [Description](#description)
* [Function Index](#index) * [Function Index](#index)
* [Function Details](#functions) * [Function Details](#functions)
Expand Down
5 changes: 1 addition & 4 deletions doc/edown_lib.md
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,6 @@
Module edown_lib
================




<h1>Module edown_lib</h1> #Module edown_lib#

* [Description](#description) * [Description](#description)
* [Function Index](#index) * [Function Index](#index)
* [Function Details](#functions) * [Function Details](#functions)
Expand Down
5 changes: 1 addition & 4 deletions doc/edown_xmerl.md
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,6 @@
Module edown_xmerl
==================




<h1>Module edown_xmerl</h1> #Module edown_xmerl#

* [Function Index](#index) * [Function Index](#index)
* [Function Details](#functions) * [Function Details](#functions)


Expand Down
Binary file removed doc/erlang.png
Binary file not shown.
55 changes: 0 additions & 55 deletions doc/stylesheet.css

This file was deleted.

2 changes: 2 additions & 0 deletions make_doc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ main([]) ->
[{doclet, edown_doclet}, [{doclet, edown_doclet},
{src_path, ["src"]}, {src_path, ["src"]},
{app_default,"http://www.erlang.org/doc/man"}, {app_default,"http://www.erlang.org/doc/man"},
{stylesheet, ""}, % don't copy stylesheet.css
{image, ""}, % don't copy erlang.png
{top_level_readme, {top_level_readme,
{"./README.md", {"./README.md",
"http://github.com/esl/edown"}}]), "http://github.com/esl/edown"}}]),
Expand Down
2 changes: 2 additions & 0 deletions rebar.config
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@
%% doesn't actually use rebar to make its own docs. %% doesn't actually use rebar to make its own docs.
%% {edoc_opts, [{doclet, edown_doclet}, %% {edoc_opts, [{doclet, edown_doclet},
%% {src_path, ["src", "test"]}, %% {src_path, ["src", "test"]},
%% {stylesheet, ""},
%% {image, ""},
%% {app_default,"http://www.erlang.org/doc/man"}]}. %% {app_default,"http://www.erlang.org/doc/man"}]}.
2 changes: 1 addition & 1 deletion src/edown.app.src
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


{application, edown, {application, edown,
[ [
{vsn, "0.2.4"}, {vsn, git},
{description, "Markdown extension for EDoc"}, {description, "Markdown extension for EDoc"},
{applications, [kernel, stdlib, edoc]}, {applications, [kernel, stdlib, edoc]},
{env, []} {env, []}
Expand Down
29 changes: 17 additions & 12 deletions src/edown_doclet.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ gen(Sources, App, Packages, Modules, FileMap, Ctxt) ->
{Modules1, Error} = sources(Sources, Dir, Modules, Env, Options), {Modules1, Error} = sources(Sources, Dir, Modules, Env, Options),
packages(Packages, Dir, FileMap, Env, Options), packages(Packages, Dir, FileMap, Env, Options),
Overview = overview(Dir, Title, Env, Options), Overview = overview(Dir, Title, Env, Options),
Data = Data =
[{h1, [Title]}] [{h1, [Title]}]
++ Overview ++ Overview
++ lists:concat([packages_frame(Packages) || Packages =/= []]) ++ lists:concat([packages_frame(Packages) || Packages =/= []])
Expand All @@ -140,7 +140,7 @@ gen(Sources, App, Packages, Modules, FileMap, Ctxt) ->
edoc_lib:write_file(Text, Dir, ?INDEX_FILE), edoc_lib:write_file(Text, Dir, ?INDEX_FILE),
edoc_lib:write_info_file(App, Packages, Modules1, Dir), edoc_lib:write_info_file(App, Packages, Modules1, Dir),
copy_stylesheet(Dir, Options), copy_stylesheet(Dir, Options),
copy_image(Dir), copy_image(Dir, Options),
make_top_level_README(Data, Options), make_top_level_README(Data, Options),
%% handle postponed error during processing of source files %% handle postponed error during processing of source files
case Error of case Error of
Expand Down Expand Up @@ -397,22 +397,27 @@ overview(Dir, Title, Env, Opts) ->
%% edoc_lib:write_file(Text, Dir, ?OVERVIEW_SUMMARY). %% edoc_lib:write_file(Text, Dir, ?OVERVIEW_SUMMARY).




copy_image(Dir) -> copy_image(Dir, Options) ->
case code:priv_dir(?EDOC_APP) of case proplists:get_value(image, Options) of
PrivDir when is_list(PrivDir) -> O when O==undefined; O==?IMAGE ->
From = filename:join(PrivDir, ?IMAGE), case code:priv_dir(?EDOC_APP) of
edoc_lib:copy_file(From, filename:join(Dir, ?IMAGE)); PrivDir when is_list(PrivDir) ->
_ -> From = filename:join(PrivDir, ?IMAGE),
report("cannot find default image file.", []), edoc_lib:copy_file(From, filename:join(Dir, ?IMAGE));
exit(error) _ ->
report("cannot find default image file.", []),
exit(error)
end;
"" ->
ok
end. end.


%% NEW-OPTIONS: stylesheet_file %% NEW-OPTIONS: stylesheet_file
%% DEFER-OPTIONS: run/2 %% DEFER-OPTIONS: run/2


copy_stylesheet(Dir, Options) -> copy_stylesheet(Dir, Options) ->
case proplists:get_value(stylesheet, Options) of case proplists:get_value(stylesheet, Options) of
undefined -> O when O==undefined; O==?STYLESHEET ->
From = case proplists:get_value(stylesheet_file, Options) of From = case proplists:get_value(stylesheet_file, Options) of
File when is_list(File) -> File when is_list(File) ->
File; File;
Expand All @@ -427,7 +432,7 @@ copy_stylesheet(Dir, Options) ->
end end
end, end,
edoc_lib:copy_file(From, filename:join(Dir, ?STYLESHEET)); edoc_lib:copy_file(From, filename:join(Dir, ?STYLESHEET));
_ -> "" ->
ok ok
end. end.


Expand Down
7 changes: 4 additions & 3 deletions src/edown_layout.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1003,9 +1003,10 @@ local_label(R) ->
"#" ++ R. "#" ++ R.




markdown(Title, _CSS, Body) -> markdown(_Title, _CSS, Body) ->
[{title, [lists:flatten(Title)]}| %% [{title, [lists:flatten(Title)]}|
Body]. %% Body].
Body.


%% xhtml(Title, CSS, Body) -> %% xhtml(Title, CSS, Body) ->
%% [{html, [?NL, %% [{html, [?NL,
Expand Down
2 changes: 1 addition & 1 deletion src/edown_xmerl.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ needs_html(T) ->
needs_html(T, []). needs_html(T, []).


needs_html(T, _Attrs) -> needs_html(T, _Attrs) ->
lists:member(T, [table,'div',h1,h2,h3,h4,dd,dt,local_defs,localdef]). lists:member(T, [table,'div',h2,h3,h4,dd,dt,local_defs,localdef]).


no_nl(S) -> no_nl(S) ->
string:strip([C || C <- to_string(S), string:strip([C || C <- to_string(S),
Expand Down

0 comments on commit 66e54e6

Please sign in to comment.