shell_docs(3)

NAME
shell_docs - Functions used to render EEP-48 style documentation for a shell.

DESCRIPTION

This module can be used to render function and type documentation to be printed in a shell. It can only render EEP-48 documentation of the format application/erlang+html. For more information about this format see Documentation Storage in Erl_Docgen's User's Guide.

DATA TYPES
docs_v1() = #docs_v1{}
chunk_element_block_type() =
    p | 'div' | br | pre | ul | ol | li | dl | dt | dd | h1 | h2 |
    h3
chunk_element_inline_type() = a | code | em | i
chunk_element_type() =
    chunk_element_inline_type() | chunk_element_block_type()

    The HTML tags allowed in application/erlang+html.
chunk_element_attr() = {atom(), unicode:chardata()}
chunk_element_attrs() = [chunk_element_attr()]
chunk_element() =
    {chunk_element_type(),
     chunk_element_attrs(),
     chunk_elements()} |
    binary()
chunk_elements() = [chunk_element()]

EXPORTS

render(Module :: module(), Docs :: docs_v1()) ->
          unicode:chardata()

    Render the documentation for a module.

render(Module :: module(), Function :: atom(), Docs :: docs_v1()) ->
          unicode:chardata() | {error, function_missing}
render(Module :: module(),
       Function :: atom(),
       Arity :: arity(),
       Docs :: docs_v1()) ->
          unicode:chardata() | {error, function_missing}

    Render the documentation for a function.

render_type(Module :: module(), Docs :: docs_v1()) ->
               unicode:chardata()

    Render a list of all available types in a module.

render_type(Module :: module(), Type :: atom(), Docs :: docs_v1()) ->
               unicode:chardata() | {error, type_missing}
render_type(Module :: module(),
            Type :: atom(),
            Arity :: arity(),
            Docs :: docs_v1()) ->
               unicode:chardata() | {error, type_missing}

    Render the documentation of a type in a module.

render_callback(Module :: module(), Docs :: docs_v1()) ->
                   unicode:chardata()

    Render a list of all available callbacks in a module.

render_callback(Module :: module(),
                Callback :: atom(),
                Docs :: docs_v1()) ->
                   unicode:chardata() | {error, callback_missing}
render_callback(Module :: module(),
                Callback :: atom(),
                Arity :: arity(),
                Docs :: docs_v1()) ->
                   unicode:chardata() | {error, callback_missing}

    Render the documentation of a callback in a module.

validate(Module) -> ok

    Types:
        Module = module() | docs_v1()

    This function can be used to do a basic validation of the doc content of application/erlang+html format.

normalize(Docs) -> NormalizedDocs

    Types:
        Docs = NormalizedDocs = chunk_elements()

    This function can be used to do whitespace normalization of application/erlang+html documentation.