Permalink
Browse files

use markdown notation in headers

  • Loading branch information...
1 parent f2b7a3d commit 4d41ead7df4f5eb465a7f01bb800c3410be95a72 Ulf Wiger committed Oct 1, 2011
Showing with 54 additions and 75 deletions.
  1. +1 −2 README.md
  2. +1 −2 doc/README.md
  3. +12 −15 doc/edown_doclet.md
  4. +14 −22 doc/edown_layout.md
  5. +7 −12 doc/edown_lib.md
  6. +8 −14 doc/edown_xmerl.md
  7. +10 −7 src/edown_layout.erl
  8. +1 −1 src/edown_xmerl.erl
View
@@ -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">
View
@@ -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">
View
@@ -12,31 +12,28 @@ EDoc Doclet module for producing Markdown.
Copyright (c) 2010 Erlang Solutions Ltd
-__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).
-
-<h2><a name="index">Function Index</a></h2>
+__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="index"></a>
+##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>
+<a name="functions"></a>
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
<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>
@@ -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
-[`//edoc/edoc:get_doc/2`](http://www.erlang.org/doc/man/edoc.html#get_doc-2) for options related to reading source
+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`](/Users/uwiger/ETC/git/edoc/doc/edoc.md#get_doc-2) for options related to reading source
files.
Options:
@@ -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>
@@ -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>
View
@@ -12,29 +12,25 @@ Markdown layout module for EDoc.
Copyright (c) 2010 Erlang Solutions Ltd
-__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).
-
-<h2><a name="description">Description</a></h2>
+__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="description"></a>
+##Description##
Derived from `edoc_layout`, which is part of the Erlang/OTP application EDoc.
-The module is intended to be used together with edoc.
-
-<h2><a name="index">Function Index</a></h2>
+The module is intended to be used together with edoc.<a name="index"></a>
+##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>
+<a name="functions"></a>
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
<a name="markdown-3"></a>
-<h3>markdown/3</h3>
-
+###markdown/3##
@@ -43,8 +39,7 @@ The module is intended to be used together with edoc.
<a name="module-2"></a>
-<h3>module/2</h3>
-
+###module/2##
@@ -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
-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.
+<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="/Users/uwiger/ETC/git/xmerl/doc/xmerl.md#export_simple_content-2"><code>//xmerl/xmerl:export_simple_content/2</code></a> for details.
</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>
-
-<h3>overview/2</h3>
+__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>
+###overview/2##
@@ -143,8 +137,7 @@ __See also:__ [//edoc/edoc:layout/2](http://www.erlang.org/doc/man/edoc.html#lay
<a name="package-2"></a>
-<h3>package/2</h3>
-
+###package/2##
@@ -153,8 +146,7 @@ __See also:__ [//edoc/edoc:layout/2](http://www.erlang.org/doc/man/edoc.html#lay
<a name="type-1"></a>
-<h3>type/1</h3>
-
+###type/1##
View
@@ -12,24 +12,21 @@ Markdown for EDoc - common support functions.
Copyright (c) 2010 Erlang Solutions Ltd
-__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).
-
-<h2><a name="index">Function Index</a></h2>
+__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="index"></a>
+##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>
+<a name="functions"></a>
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
<a name="export-1"></a>
-<h3>export/1</h3>
-
+###export/1##
@@ -38,8 +35,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla
<a name="get_attrval-2"></a>
-<h3>get_attrval/2</h3>
-
+###get_attrval/2##
@@ -48,8 +44,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla
<a name="redirect_uri-1"></a>
-<h3>redirect_uri/1</h3>
-
+###redirect_uri/1##
View
@@ -11,24 +11,21 @@
Copyright (c) 2010 Erlang Solutions Ltd
-__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).
-
-<h2><a name="index">Function Index</a></h2>
+__Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="index"></a>
+##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>
+<a name="functions"></a>
-
-<h2><a name="functions">Function Details</a></h2>
-
+##Function Details##
<a name="%23element%23-5"></a>
-<h3>'#element#'/5</h3>
-
+###'#element#'/5##
@@ -37,8 +34,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla
<a name="%23root%23-4"></a>
-<h3>'#root#'/4</h3>
-
+###'#root#'/4##
@@ -47,8 +43,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla
<a name="%23text%23-1"></a>
-<h3>'#text#'/1</h3>
-
+###'#text#'/1##
@@ -57,8 +52,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla
<a name="%23xml-inheritance%23-0"></a>
-<h3>'#xml-inheritance#'/0</h3>
-
+###'#xml-inheritance#'/0##
View
@@ -198,8 +198,9 @@ layout_module(#xmlElement{name = module, content = Es}=E, Opts) ->
++ sees(Es)
++ todos(Es)
++ if RestDesc == [] -> [];
- true -> [{h2, [{a, [{name, "description"}],
- ["Description"]}]}
+ true -> [
+ {a, [{name, "description"}], []},
+ {h2, ["Description"]}
| RestDesc]
end
++ types(lists:sort(Types), Opts)
@@ -341,8 +342,9 @@ function_index(Fs, Cols) ->
case function_index_rows(Fs, Cols, []) of
[] -> [];
Rows ->
- [{h2, [{a, [{name, ?FUNCTION_INDEX_LABEL}],
- [?FUNCTION_INDEX_TITLE]}]},
+ [
+ {a, [{name, ?FUNCTION_INDEX_LABEL}], []},
+ {h2, [?FUNCTION_INDEX_TITLE]},
{table, [{width, "100%"}, {border, 1},
{cellspacing,0}, {cellpadding,2},
{summary, "function index"}],
@@ -401,7 +403,8 @@ functions(Fs, Opts) ->
if Es == [] -> [];
true ->
[?NL,
- {h2, [{a, [{name, ?FUNCTIONS_LABEL}], [?FUNCTIONS_TITLE]}]},
+ {a, [{name, ?FUNCTIONS_LABEL}], []},
+ {h2, [?FUNCTIONS_TITLE]},
?NL | Es]
end.
@@ -519,8 +522,8 @@ types([], _Opts) -> [];
types(Ts, Opts) ->
Es = lists:flatmap(fun ({Name, E}) -> typedecl(Name, E, Opts) end, Ts),
[?NL,
- {h2, [{a, [{name, ?DATA_TYPES_LABEL}],
- [?DATA_TYPES_TITLE]}]},
+ {a, [{name, ?DATA_TYPES_LABEL}], []},
+ {h2, [?DATA_TYPES_TITLE]},
?NL | Es].
typedecl(Name, E=#xmlElement{content = Es}, Opts) ->
View
@@ -180,7 +180,7 @@ needs_html(T) ->
needs_html(T, []).
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) ->
string:strip([C || C <- to_string(S),

0 comments on commit 4d41ead

Please sign in to comment.