Permalink
Browse files

remove double h1:s, stylesheet, image

  • Loading branch information...
1 parent dbdd41e commit 66e54e6837326abf510644a9b4026a6865e8474f Ulf Wiger committed Sep 30, 2011
View
@@ -1,9 +1,6 @@
-<h1>The edown application</h1>
-
-The edown application
-=====================
+#The edown application#
Status:
------
View
@@ -1,9 +1,6 @@
-<h1>The edown application</h1>
-
-The edown application
-=====================
+#The edown application#
Status:
------
View
@@ -1,9 +1,6 @@
-Module edown_doclet
-===================
-<h1>Module edown_doclet</h1>
-
+#Module edown_doclet#
* [Description](#description)
* [Function Index](#index)
* [Function Details](#functions)
View
@@ -1,9 +1,6 @@
-Module edown_layout
-===================
-<h1>Module edown_layout</h1>
-
+#Module edown_layout#
* [Description](#description)
* [Function Index](#index)
* [Function Details](#functions)
View
@@ -1,9 +1,6 @@
-Module edown_lib
-================
-<h1>Module edown_lib</h1>
-
+#Module edown_lib#
* [Description](#description)
* [Function Index](#index)
* [Function Details](#functions)
View
@@ -1,9 +1,6 @@
-Module edown_xmerl
-==================
-<h1>Module edown_xmerl</h1>
-
+#Module edown_xmerl#
* [Function Index](#index)
* [Function Details](#functions)
View
Deleted file not rendered
View
@@ -1,55 +0,0 @@
-/* standard EDoc style sheet */
-body {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- margin-left: .25in;
- margin-right: .2in;
- margin-top: 0.2in;
- margin-bottom: 0.2in;
- color: #000000;
- background-color: #ffffff;
-}
-h1,h2 {
- margin-left: -0.2in;
-}
-div.navbar {
- background-color: #add8e6;
- padding: 0.2em;
-}
-h2.indextitle {
- padding: 0.4em;
- background-color: #add8e6;
-}
-h3.function,h3.typedecl {
- background-color: #add8e6;
- padding-left: 1em;
-}
-div.spec {
- margin-left: 2em;
- background-color: #eeeeee;
-}
-a.module,a.package {
- text-decoration:none
-}
-a.module:hover,a.package:hover {
- background-color: #eeeeee;
-}
-ul.definitions {
- list-style-type: none;
-}
-ul.index {
- list-style-type: none;
- background-color: #eeeeee;
-}
-
-/*
- * Minor style tweaks
- */
-ul {
- list-style-type: square;
-}
-table {
- border-collapse: collapse;
-}
-td {
- padding: 3
-}
View
@@ -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"}}]),
View
@@ -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"}]}.
View
@@ -17,7 +17,7 @@
{application, edown,
[
- {vsn, "0.2.4"},
+ {vsn, git},
{description, "Markdown extension for EDoc"},
{applications, [kernel, stdlib, edoc]},
{env, []}
View
@@ -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 =/= []])
@@ -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
@@ -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;
@@ -427,7 +432,7 @@ copy_stylesheet(Dir, Options) ->
end
end,
edoc_lib:copy_file(From, filename:join(Dir, ?STYLESHEET));
- _ ->
+ "" ->
ok
end.
View
@@ -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,
View
@@ -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),

0 comments on commit 66e54e6

Please sign in to comment.