shell_docs (stdlib v3.15)
This module can be used to render function and type documentation to be printed in a shell. This is the module that is used to render the docs accessed through the shell through c:h/1,2,3
. Example:
1> h(maps,new,0).
-spec new() -> Map when Map :: #{}.
Since:
OTP 17.0
Returns a new empty map.
Example:
> maps:new().
#{}
This module formats and renders 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. It can also render any other format of "text" type, although those will be rendered as is.
Link to this section Summary
Types
The HTML tags allowed in application/erlang+html
.
The HTML tags allowed in application/erlang+html
.
The HTML tags allowed in application/erlang+html
.
The configuration of how the documentation should be rendered.
The record holding EEP-48 documentation for a module. You can use code:get_doc/1 to fetch this information from a module.
Functions
This function can be used to do whitespace normalization of application/erlang+html
documentation.
Render the documentation for a module or function.
Render the documentation of a callback in a module.
Render the documentation of a type in a module.
This function can be used to find out which tags are supported by application/erlang+html
documentation.
This function can be used to do a basic validation of the doc content of application/erlang+html
format.
Link to this section Types
chunk_element()
Specs
t:shell_docs.chunk_element/0
chunk_element_attr()
Specs
t:shell_docs.chunk_element_attr/0
chunk_element_attrs()
Specs
t:shell_docs.chunk_element_attrs/0
chunk_element_block_type()
Specs
t:shell_docs.chunk_element_block_type/0
The HTML tags allowed in application/erlang+html
.
chunk_element_inline_type()
Specs
t:shell_docs.chunk_element_inline_type/0
The HTML tags allowed in application/erlang+html
.
chunk_element_type()
Specs
t:shell_docs.chunk_element_type/0
The HTML tags allowed in application/erlang+html
.
chunk_elements()
Specs
t:shell_docs.chunk_elements/0
config()
Specs
t:shell_docs.config/0
The configuration of how the documentation should be rendered.
- encoding
- Configure the encoding that should be used by the renderer for graphical details such as bullet-points. By default
shell_docs
uses the value returned byio:getopts()
. - ansi
- Configure whether ansi escape codes should be used to render graphical details such as bold and underscore. By default
shell_docs
will try to determine if the receiving shell supports ansi escape codes. It is possible to override the automated check by setting the kernel configuration parametershell_docs_ansi
to aboolean()
value. - columns
- Configure how wide the target documentation should be rendered. By default
shell_docs
used the value returned byio:columns()
.
docs_v1()
Specs
t:shell_docs.docs_v1/0
The record holding EEP-48 documentation for a module. You can use code:get_doc/1 to fetch this information from a module.
Link to this section Functions
Specs
shell_docs.normalize/1
This function can be used to do whitespace normalization of application/erlang+html
documentation.
Specs
shell_docs.render/2
Render the documentation for a module or function.
Specs
shell_docs.render/3
shell_docs.render/3
Specs
shell_docs.render/4
shell_docs.render/4
Specs
shell_docs.render/5
Specs
shell_docs.render_callback/2
Render the documentation of a callback in a module.
Specs
shell_docs.render_callback/3
shell_docs.render_callback/3
Specs
shell_docs.render_callback/4
shell_docs.render_callback/4
Specs
shell_docs.render_callback/5
Specs
shell_docs.render_type/2
Render the documentation of a type in a module.
Specs
shell_docs.render_type/3
shell_docs.render_type/3
Specs
shell_docs.render_type/4
shell_docs.render_type/4
Specs
shell_docs.render_type/5
Specs
shell_docs.supported_tags/0
This function can be used to find out which tags are supported by application/erlang+html
documentation.
Specs
shell_docs.validate/1
This function can be used to do a basic validation of the doc content of application/erlang+html
format.