Skip to content

Commit

Permalink
use markdown notation in headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Wiger committed Oct 1, 2011
1 parent f2b7a3d commit 4d41ead
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 75 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ See [bin/MARKEDOC-README.md](http://github.com/esl/edown/blob/master/bin/MARKEDO






<h2 class="indextitle">Modules</h2> ##Modules##





<table width="100%" border="0" summary="list of modules"> <table width="100%" border="0" summary="list of modules">
Expand Down
3 changes: 1 addition & 2 deletions doc/README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ See [bin/MARKEDOC-README.md](bin/MARKEDOC-README.md).






<h2 class="indextitle">Modules</h2> ##Modules##





<table width="100%" border="0" summary="list of modules"> <table width="100%" border="0" summary="list of modules">
Expand Down
27 changes: 12 additions & 15 deletions doc/edown_doclet.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,31 +12,28 @@ EDoc Doclet module for producing Markdown.


Copyright (c) 2010 Erlang Solutions Ltd Copyright (c) 2010 Erlang Solutions Ltd


__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)). __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="index"></a>

<h2><a name="index">Function Index</a></h2>


##Function Index##




<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#run-2">run/2</a></td><td>Main doclet entry point.</td></tr></table> <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#run-2">run/2</a></td><td>Main doclet entry point.</td></tr></table>




<a name="functions"></a>



##Function Details##
<h2><a name="functions">Function Details</a></h2>



<a name="run-2"></a> <a name="run-2"></a>


<h3>run/2</h3> ###run/2##








<pre>run(Command::<a href="#type-doclet_gen">doclet_gen()</a> | <a href="#type-doclet_toc">doclet_toc()</a>, Ctxt::<a href="#type-edoc_context">edoc_context()</a>) -> ok</pre>
<br></br>


<pre>run(Command :: <a href="#type-doclet_gen">doclet_gen()</a> | <a href="#type-doclet_toc">doclet_toc()</a>,
Ctxt :: <a href="#type-edoc_context">edoc_context()</a>) ->
ok</pre>






Expand All @@ -46,8 +43,8 @@ Main doclet entry point.






Also see [`//edoc/edoc:layout/2`](http://www.erlang.org/doc/man/edoc.html#layout-2) for layout-related options, and Also see [`//edoc/edoc:layout/2`](/Users/uwiger/ETC/git/edoc/doc/edoc.md#layout-2) for layout-related options, and
[`//edoc/edoc:get_doc/2`](http://www.erlang.org/doc/man/edoc.html#get_doc-2) for options related to reading source [`//edoc/edoc:get_doc/2`](/Users/uwiger/ETC/git/edoc/doc/edoc.md#get_doc-2) for options related to reading source
files. files.


Options: Options:
Expand Down Expand Up @@ -80,7 +77,7 @@ functions will also be included. The default value is <code>false</code>.






<dt><code>{overview, <a href="http://www.erlang.org/doc/man/edoc.html#type-filename">//edoc/edoc:filename()</a>}</code> <dt><code>{overview, <a href="/Users/uwiger/ETC/git/edoc/doc/edoc.md#type-filename">//edoc/edoc:filename()</a>}</code>
</dt> </dt>




Expand Down Expand Up @@ -120,7 +117,7 @@ specified, no stylesheet reference will be generated.






<dt><code>{stylesheet_file, <a href="http://www.erlang.org/doc/man/edoc.html#type-filename">//edoc/edoc:filename()</a>}</code> <dt><code>{stylesheet_file, <a href="/Users/uwiger/ETC/git/edoc/doc/edoc.md#type-filename">//edoc/edoc:filename()</a>}</code>
</dt> </dt>




Expand Down
36 changes: 14 additions & 22 deletions doc/edown_layout.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,29 +12,25 @@ Markdown layout module for EDoc.


Copyright (c) 2010 Erlang Solutions Ltd Copyright (c) 2010 Erlang Solutions Ltd


__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)). __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="description"></a>

<h2><a name="description">Description</a></h2>


##Description##
Derived from `edoc_layout`, which is part of the Erlang/OTP application EDoc. Derived from `edoc_layout`, which is part of the Erlang/OTP application EDoc.
The module is intended to be used together with edoc. The module is intended to be used together with edoc.<a name="index"></a>

<h2><a name="index">Function Index</a></h2>


##Function Index##




<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#markdown-3">markdown/3</a></td><td></td></tr><tr><td valign="top"><a href="#module-2">module/2</a></td><td>The layout function.</td></tr><tr><td valign="top"><a href="#overview-2">overview/2</a></td><td></td></tr><tr><td valign="top"><a href="#package-2">package/2</a></td><td></td></tr><tr><td valign="top"><a href="#type-1">type/1</a></td><td></td></tr></table> <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#markdown-3">markdown/3</a></td><td></td></tr><tr><td valign="top"><a href="#module-2">module/2</a></td><td>The layout function.</td></tr><tr><td valign="top"><a href="#overview-2">overview/2</a></td><td></td></tr><tr><td valign="top"><a href="#package-2">package/2</a></td><td></td></tr><tr><td valign="top"><a href="#type-1">type/1</a></td><td></td></tr></table>




<a name="functions"></a>



##Function Details##
<h2><a name="functions">Function Details</a></h2>



<a name="markdown-3"></a> <a name="markdown-3"></a>


<h3>markdown/3</h3> ###markdown/3##







Expand All @@ -43,8 +39,7 @@ The module is intended to be used together with edoc.


<a name="module-2"></a> <a name="module-2"></a>


<h3>module/2</h3> ###module/2##







Expand Down Expand Up @@ -123,18 +118,17 @@ the source file. The default value is <code>true</code>.






<dd>Specifies an <a href="http://www.erlang.org/doc/man/index.html" target="_top"><code>xmerl</code></a> callback module to be <dd>Specifies an <a href="/Users/uwiger/ETC/git/xmerl/doc/index.md" target="_top"><code>xmerl</code></a> callback module to be
used for exporting the documentation. See <a href="http://www.erlang.org/doc/man/xmerl.html#export_simple_content-2"><code>//xmerl/xmerl:export_simple_content/2</code></a> for details. used for exporting the documentation. See <a href="/Users/uwiger/ETC/git/xmerl/doc/xmerl.md#export_simple_content-2"><code>//xmerl/xmerl:export_simple_content/2</code></a> for details.
</dd> </dd>










__See also:__ [//edoc/edoc:layout/2](http://www.erlang.org/doc/man/edoc.html#layout-2), [edown_doclet:layout/2](edown_doclet.md#layout-2).<a name="overview-2"></a> __See also:__ [//edoc/edoc:layout/2](/Users/uwiger/ETC/git/edoc/doc/edoc.md#layout-2), [edown_doclet:layout/2](edown_doclet.md#layout-2).<a name="overview-2"></a>

<h3>overview/2</h3>


###overview/2##






Expand All @@ -143,8 +137,7 @@ __See also:__ [//edoc/edoc:layout/2](http://www.erlang.org/doc/man/edoc.html#lay


<a name="package-2"></a> <a name="package-2"></a>


<h3>package/2</h3> ###package/2##







Expand All @@ -153,8 +146,7 @@ __See also:__ [//edoc/edoc:layout/2](http://www.erlang.org/doc/man/edoc.html#lay


<a name="type-1"></a> <a name="type-1"></a>


<h3>type/1</h3> ###type/1##







Expand Down
19 changes: 7 additions & 12 deletions doc/edown_lib.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,24 +12,21 @@ Markdown for EDoc - common support functions.


Copyright (c) 2010 Erlang Solutions Ltd Copyright (c) 2010 Erlang Solutions Ltd


__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)). __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="index"></a>

<h2><a name="index">Function Index</a></h2>


##Function Index##




<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#export-1">export/1</a></td><td></td></tr><tr><td valign="top"><a href="#get_attrval-2">get_attrval/2</a></td><td></td></tr><tr><td valign="top"><a href="#redirect_uri-1">redirect_uri/1</a></td><td></td></tr></table> <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#export-1">export/1</a></td><td></td></tr><tr><td valign="top"><a href="#get_attrval-2">get_attrval/2</a></td><td></td></tr><tr><td valign="top"><a href="#redirect_uri-1">redirect_uri/1</a></td><td></td></tr></table>




<a name="functions"></a>



##Function Details##
<h2><a name="functions">Function Details</a></h2>



<a name="export-1"></a> <a name="export-1"></a>


<h3>export/1</h3> ###export/1##







Expand All @@ -38,8 +35,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla


<a name="get_attrval-2"></a> <a name="get_attrval-2"></a>


<h3>get_attrval/2</h3> ###get_attrval/2##







Expand All @@ -48,8 +44,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla


<a name="redirect_uri-1"></a> <a name="redirect_uri-1"></a>


<h3>redirect_uri/1</h3> ###redirect_uri/1##







Expand Down
22 changes: 8 additions & 14 deletions doc/edown_xmerl.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,24 +11,21 @@


Copyright (c) 2010 Erlang Solutions Ltd Copyright (c) 2010 Erlang Solutions Ltd


__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)). __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="index"></a>

<h2><a name="index">Function Index</a></h2>


##Function Index##




<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#%23element%23-5">'#element#'/5</a></td><td></td></tr><tr><td valign="top"><a href="#%23root%23-4">'#root#'/4</a></td><td></td></tr><tr><td valign="top"><a href="#%23text%23-1">'#text#'/1</a></td><td></td></tr><tr><td valign="top"><a href="#%23xml-inheritance%23-0">'#xml-inheritance#'/0</a></td><td></td></tr></table> <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#%23element%23-5">'#element#'/5</a></td><td></td></tr><tr><td valign="top"><a href="#%23root%23-4">'#root#'/4</a></td><td></td></tr><tr><td valign="top"><a href="#%23text%23-1">'#text#'/1</a></td><td></td></tr><tr><td valign="top"><a href="#%23xml-inheritance%23-0">'#xml-inheritance#'/0</a></td><td></td></tr></table>




<a name="functions"></a>



##Function Details##
<h2><a name="functions">Function Details</a></h2>



<a name="%23element%23-5"></a> <a name="%23element%23-5"></a>


<h3>'#element#'/5</h3> ###'#element#'/5##







Expand All @@ -37,8 +34,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla


<a name="%23root%23-4"></a> <a name="%23root%23-4"></a>


<h3>'#root#'/4</h3> ###'#root#'/4##







Expand All @@ -47,8 +43,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla


<a name="%23text%23-1"></a> <a name="%23text%23-1"></a>


<h3>'#text#'/1</h3> ###'#text#'/1##







Expand All @@ -57,8 +52,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla


<a name="%23xml-inheritance%23-0"></a> <a name="%23xml-inheritance%23-0"></a>


<h3>'#xml-inheritance#'/0</h3> ###'#xml-inheritance#'/0##







Expand Down
17 changes: 10 additions & 7 deletions src/edown_layout.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ layout_module(#xmlElement{name = module, content = Es}=E, Opts) ->
++ sees(Es) ++ sees(Es)
++ todos(Es) ++ todos(Es)
++ if RestDesc == [] -> []; ++ if RestDesc == [] -> [];
true -> [{h2, [{a, [{name, "description"}], true -> [
["Description"]}]} {a, [{name, "description"}], []},
{h2, ["Description"]}
| RestDesc] | RestDesc]
end end
++ types(lists:sort(Types), Opts) ++ types(lists:sort(Types), Opts)
Expand Down Expand Up @@ -341,8 +342,9 @@ function_index(Fs, Cols) ->
case function_index_rows(Fs, Cols, []) of case function_index_rows(Fs, Cols, []) of
[] -> []; [] -> [];
Rows -> Rows ->
[{h2, [{a, [{name, ?FUNCTION_INDEX_LABEL}], [
[?FUNCTION_INDEX_TITLE]}]}, {a, [{name, ?FUNCTION_INDEX_LABEL}], []},
{h2, [?FUNCTION_INDEX_TITLE]},
{table, [{width, "100%"}, {border, 1}, {table, [{width, "100%"}, {border, 1},
{cellspacing,0}, {cellpadding,2}, {cellspacing,0}, {cellpadding,2},
{summary, "function index"}], {summary, "function index"}],
Expand Down Expand Up @@ -401,7 +403,8 @@ functions(Fs, Opts) ->
if Es == [] -> []; if Es == [] -> [];
true -> true ->
[?NL, [?NL,
{h2, [{a, [{name, ?FUNCTIONS_LABEL}], [?FUNCTIONS_TITLE]}]}, {a, [{name, ?FUNCTIONS_LABEL}], []},
{h2, [?FUNCTIONS_TITLE]},
?NL | Es] ?NL | Es]
end. end.


Expand Down Expand Up @@ -519,8 +522,8 @@ types([], _Opts) -> [];
types(Ts, Opts) -> types(Ts, Opts) ->
Es = lists:flatmap(fun ({Name, E}) -> typedecl(Name, E, Opts) end, Ts), Es = lists:flatmap(fun ({Name, E}) -> typedecl(Name, E, Opts) end, Ts),
[?NL, [?NL,
{h2, [{a, [{name, ?DATA_TYPES_LABEL}], {a, [{name, ?DATA_TYPES_LABEL}], []},
[?DATA_TYPES_TITLE]}]}, {h2, [?DATA_TYPES_TITLE]},
?NL | Es]. ?NL | Es].


typedecl(Name, E=#xmlElement{content = Es}, Opts) -> typedecl(Name, E=#xmlElement{content = Es}, Opts) ->
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',h2,h3,h4,dd,dt,local_defs,localdef]). lists:member(T, [table,'div',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 4d41ead

Please sign in to comment.