File: docb_gen.3

package info (click to toggle)
erlang-manpages 1%3A12.b.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,188 kB
  • ctags: 2
  • sloc: makefile: 68; perl: 30; sh: 15
file content (150 lines) | stat: -rw-r--r-- 4,929 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
.TH docb_gen 3 "docbuilder  0.9.8.4" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
docb_gen \- Generate XML from EDoc comments in Erlang source code\&. 
.SH DESCRIPTION
.LP
\fIdocb_gen\fR contains functions for generating XML documentation source code according to the \fIerlref\fR or \fIchapter\fR DTD from EDoc comments in Erlang source code or an \fIoverview\&.edoc\fR file, using EDoc\&.

.SH EXPORTS
.LP
.B
module(File) -> ok | {error, Reason}
.br
.B
module(File, Options) -> ok | {error, Reason}
.br
.RS
.TP
Types
File = string()
.br
Options = [Opt]
.br
Opt = {def, Defs} | {includes, Dirs} | {preprocess, Bool} | {sort_functions, Bool}
.br
Defs = [{atom(), string()}]
.br
Dirs = [string()]
.br
Bool = bool()
.br
Reason = badfile | {badopt, term()} | term()
.br
.RE
.RS
.LP
Generates XML documentation source code according to the \fIerlref\fR DTD from EDoc comments \fIFile\fR, using the EDoc application\&.
.LP
\fIFile\fR is an Erlang source file, given with or without the \fI\&.erl\fR extension as \fIName\&.erl\fR or \fIName\fR\&. The resulting XML file is created in the current working directory and named \fIName\&.xml\fR\&.
.LP
\fIOptions\fR is a list of options, see below\&.
.LP
Returns \fIok\fR if successful, and an error tuple otherwise\&.
.RE
.LP
.B
users_guide(File) -> ok | {error, Reason}
.br
.B
users_guide(File, Options) -> ok | {error, Reason}
.br
.RS
.TP
Types
File -- see module/1, 2
.br
Options -- see module/1, 2
.br
Reason -- see module/1, 2
.br
.RE
.RS
.LP
Like \fImodule/1, 2\fR but generates XML source code according to the \fIchapter\fR DTD from an \fIoverview\&.edoc\fR or similar file\&.
.LP
The resulting file is named \fIchapter\&.xml\fR\&.
.RE
.SH OPTIONS
.RS 2
.TP 4
.B
\fI{def, [{Name, Text}]}\fR:
Specifies EDoc macro definitions\&. See edoc:get_doc/2\&.
.TP 4
.B
\fI{includes, [Dir]}\fR:
Specifies directories where EDoc should search for include files\&. See edoc:read_source/2\&.
.TP 4
.B
\fI{preprocess, true|false}\fR:
Specifies if EDoc should read the source file via the Erlang preprocessor\&. Default is \fIfalse\fR\&. See edoc:read_source/2\&.
.TP 4
.B
\fI{sort_functions, true|false}\fR:
Specifies if the functions in the resulting XML file should be sorted alphabetically\&. Default is \fItrue\fR\&.
.RE
.SH LIMITATIONS
.LP
The mapping from the EDoc XHTML output to valid Erlang/OTP XML is not complete\&. An attempt has been made to cover the most commonly used XHTML constructs, but there will still be cases where XML generation fails or where the resulting XML is inadequate\&. This is especially true for \fIusers_guide/1, 2\fR\&. 
.LP
Known limitations for some XHTML tags:
.RS 2
.TP 4
.B
\fI<a>\fR:
All attributes except the first \fIhref\fR or \fIname\fR attribute are ignored\&.
.RS 4
.LP

.LP
A \fIhref\fR attribute means the \fI<a>\fR tag will be transformed to a \fI<seealso>\fR or \fI<url>\fR tag and an attempt is made to resolve the reference if necessary\&.
.LP

.LP
A \fIname\fR attribute means the \fI<a>\fR tag will be transformed to a \fI<marker>\fR tag\&.
.RE
.TP 4
.B
\fI<b>, <em>, <pre>\fR:
Cannot contain other tags in Erlang/OTP XML, content is converted to plain text\&.
.TP 4
.B
\fI<center>\fR:
No corresponding Erlang/OTP XML tag, converted to plain text\&.
.TP 4
.B
\fI<font>\fR:
No corresponding Erlang/OTP XML tag, converted to plain text\&.
.TP 4
.B
\fI<h1>, <h2>, \&.\&.\&.\fR:
There is no tag corresponding to a header in Erlang/OTP XML, so these are converted to plain text instead, with the exception of \fI<h3>\fR and \fI<h4>\fR tags within \fIoverview\&.edoc\fR, see part about "\fIchapter\fR DTD" below\&.
.TP 4
.B
\fI<sup>\fR:
There is no tag corresponding to superscript in Erlang/OTP XML, so this is converted to plain text within brackets "(\&.\&.)"\&.
.TP 4
.B
References:
The markers automatically inserted by EDoc at each heading and function will override the markers automatically inserted by DocBuilder, with the unfortunate result that the links in the left-hand frame of the User\&'s Guide will not work, and also that cross referencing a function in a module the usual Erlang/OTP way "\fI<seealso marker="edoc:edoc#run/3\&.\&.\&.>\fR" does not work\&. (But "\fI<seealso marker="edoc:edoc#run-3\&.\&.\&.>\fR" does\&.)
.RE
.LP
\fIerlref DTD\fR
.RS 2
.TP 4
.B
Tables:
Tables are not allowed\&. The contents of a table is converted to text instead, each row corresponding to one line of text\&.
.RE
.LP
\fIchapter DTD\fR
.RS 2
.TP 4
.B
Sections:
Only two levels of sections\&. \fI<h3>\fR (equivalent to EDoc headings "\fI== Heading ==\fR") is interpreted as start of top-level section, or if there is no \fI<h3>\fR tag, the entire document is made into one top-level section\&. \fI<h4>\fR (equivalent to EDoc sub-headings ("\fI=== Sub-heading ===\fR") is interpreted as start of second-level section\&.
.TP 4
.B
Tables:
Tables without borders are converted to text in the same manner as for the \fIerlref\fR DTD\&.
.RE