fix build docs

This commit is contained in:
Led 2015-08-03 00:24:58 +03:00
parent 3a051c60dd
commit fef001479f
3 changed files with 25 additions and 12 deletions

View file

@ -4,3 +4,4 @@
{platform_define, "R14|R15", 'no_binary_to_whatever'}, {platform_define, "R14|R15", 'no_binary_to_whatever'},
{platform_define, "^((?!R1[456]).)*$", 'maps_support'} {platform_define, "^((?!R1[456]).)*$", 'maps_support'}
]}. ]}.
{edoc_opts, [{preprocess, true}]}.

View file

@ -67,23 +67,29 @@
-type config() :: jsx_config:config(). -type config() :: jsx_config:config().
-spec encode(Source::json_term()) -> json_text(). -spec encode(Source::json_term()) -> json_text().
-spec encode(Source::json_term(), Config::jsx_to_json:config()) -> json_text() | {incomplete, encoder()}.
encode(Source) -> encode(Source, []). encode(Source) -> encode(Source, []).
-spec encode(Source::json_term(), Config::jsx_to_json:config()) -> json_text() | {incomplete, encoder()}.
encode(Source, Config) -> jsx_to_json:to_json(Source, Config). encode(Source, Config) -> jsx_to_json:to_json(Source, Config).
-spec decode(Source::json_text()) -> json_term(). -spec decode(Source::json_text()) -> json_term().
-spec decode(Source::json_text(), Config::jsx_to_term:config()) -> json_term() | {incomplete, decoder()}.
decode(Source) -> decode(Source, []). decode(Source) -> decode(Source, []).
-spec decode(Source::json_text(), Config::jsx_to_term:config()) -> json_term() | {incomplete, decoder()}.
decode(Source, Config) -> jsx_to_term:to_term(Source, Config). decode(Source, Config) -> jsx_to_term:to_term(Source, Config).
-spec format(Source::json_text()) -> json_text(). -spec format(Source::json_text()) -> json_text().
-spec format(Source::json_text(), Config::jsx_to_json:config()) -> json_text() | {incomplete, decoder()}.
format(Source) -> format(Source, []). format(Source) -> format(Source, []).
-spec format(Source::json_text(), Config::jsx_to_json:config()) -> json_text() | {incomplete, decoder()}.
format(Source, Config) -> jsx_to_json:format(Source, Config). format(Source, Config) -> jsx_to_json:format(Source, Config).
@ -97,24 +103,30 @@ minify(Source) -> format(Source, []).
prettify(Source) -> format(Source, [space, {indent, 2}]). prettify(Source) -> format(Source, [space, {indent, 2}]).
-spec is_json(Source::any()) -> true | false. -spec is_json(Source::any()) -> boolean().
-spec is_json(Source::any(), Config::jsx_verify:config()) -> true | false | {incomplete, decoder()}.
is_json(Source) -> is_json(Source, []). is_json(Source) -> is_json(Source, []).
-spec is_json(Source::any(), Config::jsx_verify:config()) -> boolean() | {incomplete, decoder()}.
is_json(Source, Config) -> jsx_verify:is_json(Source, Config). is_json(Source, Config) -> jsx_verify:is_json(Source, Config).
-spec is_term(Source::any()) -> true | false. -spec is_term(Source::any()) -> boolean().
-spec is_term(Source::any(), Config::jsx_verify:config()) -> true | false | {incomplete, encoder()}.
is_term(Source) -> is_term(Source, []). is_term(Source) -> is_term(Source, []).
-spec is_term(Source::any(), Config::jsx_verify:config()) -> boolean() | {incomplete, encoder()}.
is_term(Source, Config) -> jsx_verify:is_term(Source, Config). is_term(Source, Config) -> jsx_verify:is_term(Source, Config).
-spec consult(File::file:name_all()) -> list(json_term()). -spec consult(File::file:name_all()) -> list(json_term()).
-spec consult(File::file:name_all(), Config::jsx_to_term:config()) -> list(json_term()).
consult(File) -> consult(File, []). consult(File) -> consult(File, []).
-spec consult(File::file:name_all(), Config::jsx_to_term:config()) -> list(json_term()).
consult(File, Config) -> jsx_consult:consult(File, Config). consult(File, Config) -> jsx_consult:consult(File, Config).
@ -170,7 +182,7 @@ resume(Term, {parser, State, Handler, Stack}, Config) ->
jsx_parser:resume(Term, State, Handler, Stack, jsx_config:parse_config(Config)). jsx_parser:resume(Term, State, Handler, Stack, jsx_config:parse_config(Config)).
-spec maps_support() -> true | false. -spec maps_support() -> boolean().
-ifndef(maps_support). -ifndef(maps_support).
maps_support() -> false. maps_support() -> false.

View file

@ -58,8 +58,6 @@
-endif. -endif.
-spec consult(File::file:name_all(), Config::config()) -> [json_value()].
-ifdef(maps_always). -ifdef(maps_always).
opts(Opts) -> [return_maps, multi_term] ++ Opts. opts(Opts) -> [return_maps, multi_term] ++ Opts.
-endif. -endif.
@ -67,6 +65,8 @@ opts(Opts) -> [return_maps, multi_term] ++ Opts.
opts(Opts) -> [multi_term] ++ Opts. opts(Opts) -> [multi_term] ++ Opts.
-endif. -endif.
-spec consult(File::file:name_all(), Config::config()) -> [json_value()].
consult(File, Config) when is_list(Config) -> consult(File, Config) when is_list(Config) ->
case file:read_file(File) of case file:read_file(File) of
{ok, Bin} -> {ok, Bin} ->