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         edoc_env() = edoc_lib:edoc_env():
13
14
15         filename() = file:filename():
16
17
18         proplist() = proplists:property():
19
20
21         syntaxTree() = erl_syntax:syntaxTree():
22
23

EXPORTS

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

SEE ALSO

152       edoc
153

AUTHORS

155       Richard Carlsson <carlsson.richard@gmail.com>
156
157
158
159                                   edoc 0.11                   edoc_extract(3)
Impressum