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 Diff line number Diff line change
@@ -1,9 +1,6 @@


<h1>The edown application</h1>

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

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


<h1>The edown application</h1>

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

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


<h1>Module edown_doclet</h1>

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


<h1>Module edown_layout</h1>

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


<h1>Module edown_lib</h1>

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

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


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

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

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

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


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

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

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) ->
string:strip([C || C <- to_string(S),
Expand Down

0 comments on commit 66e54e6

Please sign in to comment.