1shell_docs(3) Erlang Module Definition shell_docs(3)
2
3
4
6 shell_docs - Functions used to render EEP-48 style documentation for a
7 shell.
8
10 This module can be used to render function and type documentation to be
11 printed in a shell. It can only render EEP-48 documentation of the for‐
12 mat application/erlang+html. For more information about this format see
13 Documentation Storage in Erl_Docgen's User's Guide.
14
16 docs_v1() = #docs_v1{}
17
18 The record holding EEP-48 documentation for a module. You can
19 use code:get_doc/1 to fetch this information from a module.
20
21 config() =
22 #{encoding => unicode | latin1,
23 columns => integer() >= 1,
24 ansi => boolean()}
25
26 The configuration of how the documentation should be rendered.
27
28 encoding:
29 Configure the encoding that should be used by the renderer
30 for graphical details such as bullet-points. By default
31 shell_docs uses the value returned by io:getopts().
32
33 ansi:
34 Configure whether ansi escape codes should be used to ren‐
35 der graphical details such as bold and underscore. By
36 default shell_docs will try to determine if the receiving
37 shell supports ansi escape codes. It is possible to override
38 the automated check by setting the kernel configuration
39 parameter shell_docs_ansi to a boolean() value.
40
41 columns:
42 Configure how wide the target documentation should be ren‐
43 dered. By default shell_docs used the value returned by
44 io:columns().
45
46 chunk_element_block_type() =
47 p | 'div' | br | pre | ul | ol | li | dl | dt | dd | h1 | h2 |
48 h3
49
50 chunk_element_inline_type() = a | code | em | i
51
52 chunk_element_type() =
53 chunk_element_inline_type() | chunk_element_block_type()
54
55 The HTML tags allowed in application/erlang+html.
56
57 chunk_element_attr() = {atom(), unicode:chardata()}
58
59 chunk_element_attrs() = [chunk_element_attr()]
60
61 chunk_element() =
62 {chunk_element_type(),
63 chunk_element_attrs(),
64 chunk_elements()} |
65 binary()
66
67 chunk_elements() = [chunk_element()]
68
70 render(Module, Docs) -> unicode:chardata()
71
72 render(Module, Docs, Config) -> unicode:chardata()
73
74 render(Module, Function, Docs) -> Res
75
76 render(Module, Function, Docs, Config) -> Res
77
78 render(Module, Function, Arity, Docs) -> Res
79
80 render(Module, Function, Arity, Docs, Config) -> Res
81
82 Types:
83
84 Module = module()
85 Function = atom()
86 Arity = arity()
87 Docs = docs_v1()
88 Config = config()
89 Res = unicode:chardata() | {error, function_missing}
90
91 Render the documentation for a module or function.
92
93 render_type(Module, Docs) -> unicode:chardata()
94
95 render_type(Module, Docs, Config) -> unicode:chardata()
96
97 render_type(Module, Type, Docs) -> Res
98
99 render_type(Module, Type, Docs, Config) -> Res
100
101 render_type(Module, Type, Arity, Docs) -> Res
102
103 render_type(Module, Type, Arity, Docs, Config) -> Res
104
105 Types:
106
107 Module = module()
108 Type = atom()
109 Arity = arity()
110 Docs = docs_v1()
111 Config = config()
112 Res = unicode:chardata() | {error, type_missing}
113
114 Render the documentation of a type in a module.
115
116 render_callback(Module, Docs) -> unicode:chardata()
117
118 render_callback(Module, Docs, Config) -> unicode:chardata()
119
120 render_callback(Module, Callback, Docs) -> Res
121
122 render_callback(Module, Callback, Docs, Config) -> Res
123
124 render_callback(Module, Callback, Arity, Docs) -> Res
125
126 render_callback(Module, Callback, Arity, Docs, Config) -> Res
127
128 Types:
129
130 Module = module()
131 Callback = atom()
132 Arity = arity()
133 Docs = docs_v1()
134 Config = config()
135 Res = unicode:chardata() | {error, callback_missing}
136
137 Render the documentation of a callback in a module.
138
139 validate(Module) -> ok
140
141 Types:
142
143 Module = module() | docs_v1()
144
145 This function can be used to do a basic validation of the doc
146 content of application/erlang+html format.
147
148 normalize(Docs) -> NormalizedDocs
149
150 Types:
151
152 Docs = NormalizedDocs = chunk_elements()
153
154 This function can be used to do whitespace normalization of
155 application/erlang+html documentation.
156
157
158
159Ericsson AB stdlib 3.14.1 shell_docs(3)