1edoc_extract(3)            Erlang Module Definition            edoc_extract(3)
2
3
4

NAME

6       edoc_extract - EDoc documentation extraction.
7

DESCRIPTION

9       EDoc documentation extraction.
10

DATA TYPES

12         context() = module | footer | function | overview | single:
13
14
15         filename() = file:filename():
16
17
18         proplist() = proplists:proplist():
19
20

EXPORTS

22       file(File, Context, Env, Opts) -> {ok, Tags} | {error, Reason}
23
24              Types:
25
26                 File = filename()
27                 Context = context()
28                 Env = edoc:env()
29                 Opts = proplist()
30                 Tags = [term()]
31                 Reason = term()
32
33              Reads  a text file and returns the list of tags in the file. Any
34              lines of text before the first tag are ignored. Env is an  envi‐
35              ronment created by edoc_lib:get_doc_env/3. Upon error, Reason is
36              an atom returned from the call to file:read_file/1 or  the  atom
37              'invalid_unicode'.
38
39              See text/4 for options.
40
41       header(File, Env, Opts) -> edoc:entry_data()
42
43              Types:
44
45                 File = filename()
46                 Env = edoc:env()
47                 Opts = proplist()
48
49              Similar  to header/5, but reads the syntax tree and the comments
50              from the specified file.
51
52              See also: header/4, edoc:read_comments/2, edoc:read_source/2.
53
54       header(Forms, File, Env, Opts) -> edoc:entry_data()
55
56              Types:
57
58                 Forms = erl_syntax:forms()
59                 File = filename()
60                 Env = edoc:env()
61                 Opts = proplist()
62
63              Extracts EDoc documentation from commented  header  file  syntax
64              trees.  Similar  to source/5, but ignores any documentation that
65              occurs before a module declaration  or  a  function  definition.
66              (Warning messages are printed if content may be ignored.) Env is
67              assumed to already be set up with a suitable module context.
68
69              See also: erl_recomment(3), header/5.
70
71       header(Forms, Comments, File, Env, Opts) -> edoc:entry_data()
72
73              Types:
74
75                 Forms = erl_syntax:forms()
76                 Comments = [edoc:comment()]
77                 File = filename()
78                 Env = edoc:env()
79                 Opts = proplist()
80
81              Similar to header/4, but first inserts the given comments in the
82              syntax  trees.  The syntax trees must contain valid position in‐
83              formation. (Cf. edoc:read_comments/2.)
84
85              See also: erl_recomment(3), header/3, header/4.
86
87       source(File, Env, Opts) -> R
88
89              Types:
90
91                 File = filename()
92                 Env = edoc:env()
93                 Opts = proplist()
94                 R   =    {module(),    edoc:edoc_module()}    |    {module(),
95                 edoc:edoc_module(), [edoc:entry()]}
96
97              Like  source/5,  but reads the syntax tree and the comments from
98              the specified file.
99
100              See also: source/4, edoc:read_comments/2, edoc:read_source/2.
101
102       source(Forms, File, Env, Opts) -> R
103
104              Types:
105
106                 Forms = erl_syntax:forms()
107                 File = filename()
108                 Env = edoc:env()
109                 Opts = proplist()
110                 R   =    {module(),    edoc:edoc_module()}    |    {module(),
111                 edoc:edoc_module(), [edoc:entry()]}
112
113              Extracts  EDoc  documentation  from commented source code syntax
114              trees. The given Forms must be a  single  syntax  tree  of  type
115              form_list,  or  a  list  of  syntax  trees representing "program
116              forms" (cf. edoc:read_source/2. Env is an environment created by
117              edoc_lib:get_doc_env/3.  The File argument is used for error re‐
118              porting and output file name generation only.
119
120              See edoc:get_doc/2 for descriptions of the def, hidden, private,
121              and todo options.
122
123              See   also:  erl_recomment(3),  source/5,  edoc:read_comments/2,
124              edoc:read_source/2.
125
126       source(Forms, Comments, File, Env, Opts) -> R
127
128              Types:
129
130                 Forms = erl_syntax:forms()
131                 Comments = [edoc:comment()]
132                 File = filename()
133                 Env = edoc:env()
134                 Opts = proplist()
135                 R   =    {module(),    edoc:edoc_module()}    |    {module(),
136                 edoc:edoc_module(), [edoc:entry()]}
137
138              Like  source/4, but first inserts the given comments in the syn‐
139              tax trees. The syntax trees must contain valid position informa‐
140              tion. (Cf. edoc:read_comments/2.)
141
142              See  also:  erl_recomment(3), source/3, source/4, edoc:read_com‐
143              ments/2, edoc:read_source/2.
144
145       text(Text, Context, Env, Opts) -> Tags
146
147              Types:
148
149                 Text = string()
150                 Context = context()
151                 Env = edoc:env()
152                 Opts = proplist()
153                 Tags = [term()]
154
155              Returns the list of tags in the text. Any lines of  text  before
156              the  first  tag  are  ignored.  Env is an environment created by
157              edoc_lib:get_doc_env/3.
158
159              See source/4 for a description of the def option.
160

SEE ALSO

162       edoc
163

AUTHORS

165       Richard Carlsson <carlsson.richard@gmail.com>
166
167
168
169                                   edoc 1.1                    edoc_extract(3)
Impressum