diff --git a/doc/edown_doclet.md b/doc/edown_doclet.md index 19acadd..19c4954 100644 --- a/doc/edown_doclet.md +++ b/doc/edown_doclet.md @@ -31,7 +31,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla -
run(Command::doclet_gen() | doclet_toc(), Ctxt::edoc_context()) -> ok
+
run(Command::[doclet_gen()](#type-doclet_gen) | [doclet_toc()](#type-doclet_toc), Ctxt::[edoc_context()](#type-edoc_context)) -> ok


@@ -43,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: @@ -77,7 +77,7 @@ functions will also be included. The default value is false. -
{overview, //edoc/edoc:filename()} +
{overview, //edoc/edoc:filename()}
@@ -117,7 +117,7 @@ specified, no stylesheet reference will be generated. -
{stylesheet_file, //edoc/edoc:filename()} +
{stylesheet_file, //edoc/edoc:filename()}
diff --git a/doc/edown_layout.md b/doc/edown_layout.md index 160336b..ef94c7b 100644 --- a/doc/edown_layout.md +++ b/doc/edown_layout.md @@ -118,15 +118,15 @@ the source file. The default value is true. -
Specifies an xmerl callback module to be -used for exporting the documentation. See //xmerl/xmerl:export_simple_content/2 for details. +
Specifies an xmerl callback module to be +used for exporting the documentation. See //xmerl/xmerl:export_simple_content/2 for details.
-__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). +__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). ###overview/2## diff --git a/doc/edown_make.md b/doc/edown_make.md index fb586db..a75abd9 100644 --- a/doc/edown_make.md +++ b/doc/edown_make.md @@ -26,7 +26,7 @@ -
from_script(Config::ConfigFile) -> ok | {error, Reason}
+
from_script(Config::ConfigFile) -> ok | {error, Reason}


@@ -49,7 +49,7 @@ This function does not manage dependencies. It is simply a wrapper around -
main(Args::[Config]) -> no_return()
+
main(Args::[Config]) -> [no_return()](#type-no_return)


diff --git a/src/edown_layout.erl b/src/edown_layout.erl index b22d109..b5efdaa 100644 --- a/src/edown_layout.erl +++ b/src/edown_layout.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%============================================================================== %% @author Ulf Wiger -%% @copyright 2010 Erlang Solutions Ltd +%% @copyright 2010 Erlang Solutions Ltd %% @end %% ===================================================================== @@ -572,7 +572,7 @@ format_spec(Name, Type, Defs, #opts{pretty_printer = erl_pp}=Opts) -> L = t_clause(Name, Type), O = pp_clause(Name, Type), {R, ".\n"} = etypef(L, O), - [{pre, R}] + [{pre_pre, R}] catch _:_ -> %% Example: "@spec ... -> record(a)" format_spec(Name, Type, Defs, Opts#opts{pretty_printer=''}) @@ -580,7 +580,7 @@ format_spec(Name, Type, Defs, #opts{pretty_printer = erl_pp}=Opts) -> format_spec(Sep, Type, Defs, _Opts) -> %% Very limited formatting. Br = if Defs =:= [] -> br; true -> [] end, - [{pre, t_clause(Sep, Type)}, Br]. + [{pre_pre, t_clause(Sep, Type)}, Br]. t_clause(Name, Type) -> #xmlElement{content = [#xmlElement{name = 'fun', content = C}]} = Type, @@ -599,13 +599,13 @@ format_type(Prefix, Name, Type, Last, #opts{pretty_printer = erl_pp}=Opts) -> L = t_utype(Type), O = pp_type(Name, Type), {R, ".\n"} = etypef(L, O), - [{pre, Prefix ++ [" = "] ++ R ++ Last}] + [{pre_pre, Prefix ++ [" = "] ++ R ++ Last}] catch _:_ -> %% Example: "t() = record(a)." format_type(Prefix, Name, Type, Last, Opts#opts{pretty_printer =''}) end; format_type(Prefix, _Name, Type, Last, _Opts) -> - [{pre, Prefix ++ [" = "] ++ t_utype(Type) ++ Last}]. + [{pre_pre, Prefix ++ [" = "] ++ t_utype(Type) ++ Last}]. pp_type(Prefix, Type) -> Atom = list_to_atom(lists:duplicate(iolist_size(Prefix), $a)), diff --git a/src/edown_xmerl.erl b/src/edown_xmerl.erl index d658217..c351538 100644 --- a/src/edown_xmerl.erl +++ b/src/edown_xmerl.erl @@ -68,6 +68,8 @@ rstrip(Str) -> re:replace(Str, "\\s\$", []). %% for an example. (By default, we always generate the end tag, to make %% sure that the scope of a markup is not extended by mistake.) +'#element#'('pre_pre', Data, Attrs, Parents, E) -> + '#element#'(pre, escape_pre(Data), Attrs, Parents, E); '#element#'('pre', Data, Attrs, Parents, E) -> xmerl_html:'#element#'('pre', Data, Attrs, Parents, E); '#element#'('div', Data, _, _Parents, _E) -> @@ -99,6 +101,9 @@ elem(Tag, Data, Attrs, Parents, E) -> md_elem(Tag, Data, Attrs, Parents, E) end. +escape_pre(Data) -> + re:replace(re:replace(Data, "<", "\\<", [global]), ">", "\\>", [global]). + alias_for(Tag, Data, Attrs, Parents, E) -> xmerl_html:'#element#'(Tag, Data, Attrs, Parents, E#xmlElement{name = Tag}).