anchor.diff:                                "## Types~n~s~n",
                                 [ModDoc, types(Docs)])
           end,
  -    do_with_docs(Mod, F).
  +    do_with_docs(Mod, F, []).
   
  --spec h(module(), fname(), arity()) -> ok.
  -h(Mod, Fun, Arity) ->
  -    F = fun (Docs) ->
  -                case {lists:keyfind(docs, 1, Docs),
  -                      lists:keyfind(specs, 1, Docs)} of
  -                    {false, false} -> error({no_docs, <<"neither docs nor specs found">>});
  -                    {false, {_, Specs}} -> format({Fun, Arity}, no_docs, Specs);
  -                    {{_, FDocs}, false} -> format({Fun, Arity}, FDocs, no_specs);
  -                    {{_, FDocs}, {_, Specs}} -> format({Fun, Arity}, FDocs, Specs)
  +-spec h(module(), fname(), arity(), [term()]) -> ok.
  +h(Mod, Fun, Arity, Opts) ->
  +    F = fun (Docs, Opts) ->
  +                case fetch_function({Fun, Arity}, Docs) of
  +                    {no_docs, no_specs} ->
  +                        error({no_docs, <<"neither doc comments nor specs found">>});
  +                    {{doc, not_found}, {spec, not_found}} ->
  +                        error({no_docs, <<(mfa(Mod, Fun, Arity))/bytes, " not found">>});
  +                    {{doc, Doc}, {spec, Spec}} ->
  +                        format([ {doc, Doc}   || proplists:is_defined(doc, Opts) ] ++
  +                               [ {spec, Spec} || proplists:is_defined(spec, Opts) ])
                   end
           end,
  -    do_with_docs(Mod, F).
  +    do_with_docs(Mod, F, Opts).
   
  -do_with_docs(Mod, Fun) ->
  +do_with_docs(Mod, Fun, Opts) ->
       T = try
  -            do_with_supported(Fun, get_elixir_docs_v1(Mod))
  +            do_with_supported(Fun, get_elixir_docs_v1(Mod), Opts)
           catch
               error:{no_docs, R} ->
  -                <<"Module documentation not found:", R/bytes>>;
  +                <<"Docs missing:", R/bytes>>;
               _:R ->
                   ?il2b([<<"docsh error: ">>,
                          io_lib:format("~p\n~p\n", [R, erlang:get_stacktrace()])])
           end,
       io:format("~s~n", [T]).
   
  -do_with_supported(Fun, {elixir_docs_v1, Docs}) ->
  -    Fun(Docs);
  -do_with_supported(_, _) ->
  +do_with_supported(Fun, {elixir_docs_v1, Docs}, Opts) ->
  +    Fun(Docs, Opts);
  +do_with_supported(_, _, _) ->
       <<"Documentation format not supported">>.
   
  -format(FunArity, no_docs, Specs) ->
  -    {FunArity, Spec} = lists:keyfind(FunArity, 1, Specs),
  -    io_lib:format("~s", [Spec]);
  -format(FunArity, Docs, no_specs) ->
  -    {FunArity, _, _, _, Doc} = lists:keyfind(FunArity, 1, Docs),
  -    io_lib:format("~s", [Doc]);
  -format(FunArity, Docs, Specs) ->
  -    {FunArity, _, _, _, Doc} = lists:keyfind(FunArity, 1, Docs),
  -    {FunArity, Spec} = lists:keyfind(FunArity, 1, Specs),
  -    io_lib:format("~s~n~s", [Spec, Doc]).
  +fetch_function(_, _) ->
  +    not_implemented_yet.
  +
  +fetch_doc(FunArity, Docs) ->
  +    {doc, case lists:keyfind(FunArity, 1, Docs) of
  +              false -> not_found;
  +              {FunArity, _, _, Doc} -> Doc
  +          end}.
  +
  +fetch_spec(FunArity, Specs) ->
  +    {spec, case lists:keyfind(FunArity, 1, Specs) of
  +               false -> not_found;
  +               {FunArity, Spec} -> Spec
  +           end}.
  +
  +format(_) ->
  +    not_implemented_yet.
   
   types(Docs) ->
       Types = proplists:get_value(types, Docs, []),
  
positive.code: -module(docsh_embeddable).
  -compile([debug_info,
            {inline, [get_elixir_docs_v1/1,
                      do_with_docs/2,
                      do_with_supported/2,
                      types/1]}]).
  
  -export([h/1,
           h/3]).
  
  -type fname() :: atom().
  
  
negative.code: 
  -spec h(module()) -> ok.
  h(Mod) ->
      F = fun (Docs, _) ->
                  {_, ModDoc} = proplists:get_value(moduledoc, Docs),
                  %% TODO: work on the printout format in cases
                  %%       of unavailable docs
  