STDLIB

Reference Manual

Version 3.13.2

Table of Contents

shell_docs

Module

shell_docs

Module Summary

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

Since

Module shell_docs was introduced in OTP 23.0.

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.

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

Render the documentation for a module.

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

Render the documentation for a function.

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

Render a list of all available types in a module.

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

Render the documentation of a type in a module.

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

Render a list of all available callbacks in a module.

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

Render the documentation of a callback in a module.

validate(Module) -> ok
OTP 23.0

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
OTP 23.0

Types

Docs = NormalizedDocs = chunk_elements()

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