aboutsummaryrefslogtreecommitdiffstats
path: root/lib/docbuilder/doc/src/docb_transform.xml
blob: 06a04c8c02d2a24e591b4718265c974451748c89 (plain) (blame)
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<?xml version="1.0" encoding="latin1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2001</year>
      <year>2011</year>
      <holder>Ericsson AB, All Rights Reserved</holder>
    </copyright>
    <legalnotice>
  The contents of this file are subject to the Erlang Public License,
  Version 1.1, (the "License"); you may not use this file except in
  compliance with the License. You should have received a copy of the
  Erlang Public License along with this software. If not, it can be
  retrieved online at http://www.erlang.org/.

  Software distributed under the License is distributed on an "AS IS"
  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
  the License for the specific language governing rights and limitations
  under the License.

  The Initial Developer of the Original Code is Ericsson AB.
    </legalnotice>

    <title>docb_transform</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
  </header>
  <module>docb_transform</module>
  <modulesummary>Transform XML to HTML</modulesummary>
  <description>
    <p><c>docb_transform</c> contains functions for transforming XML
      documentation source code to HTML.</p>
  </description>

  <funcs>
    <func>
      <name>file(File) -> ok | {error, Reason}</name>
      <name>file(File, Options) -> ok | {error, Reason}</name>
      <fsummary>Transform XML to HTML</fsummary>
      <type>
	<v>File = string()</v>
	<v>Options = [Opt]</v>
	<v>Opt -- see below</v>
      </type>
      <desc>
        <p>Transforms XML documentation source code to HTML.</p>

        <p><c>File</c> is a documentation source file, given with or
	  without the <c>.xml</c> extension as <c>Name.xml</c> or
	  <c>Name</c>.</p>

	<p>If <c>File</c> contains XML code according to a basic DTD
	  (<c>chapter</c>, <c>erlref</c>, ...), the resulting HTML
	  file is named <c>Name.html</c>.</p>

        <p>If <c>File</c> contains XML code according to a compound DTD
	  (<c>application</c> or <c>part</c>), several files are
	  created:</p>
	<list>
	  <item>A cover page for the application with two frames,
	    <c>Name_frame.html</c>.</item>
	  <item>The contents of the left frame and a front page,
	    <c>Name.html</c> and <c>Name_first.html</c>.</item>
	  <item>A bibliography and a glossary, <c>Name_cite.html</c>
	    and <c>Name_term.html</c>.</item>
	  <item>In the case of an <c>application</c> DTD an index
	    is created, <c>Name.kwc</c> and <c>Name_index.html</c>.
	  </item>
	  <item>One HTML file for each file included from <c>File</c>.
	  </item>
	  <item>Also, if there exists a <c>fascicules.xml</c> file where
	    the value of the <c>entry</c> attribute for <c>File</c> is
	    <c>"yes"</c>, the cover page is copied to <c>index.html</c>.
	  </item>
	</list>
      </desc>
    </func>
  </funcs>

  <section>
    <title>Options</title>
    <taglist>
      <tag><c>{html_mod, Module}, Module=atom()</c></tag>
      <item>
	<p>A callback module can be used for specifying HTML snippets
	  that should be included in the generated HTML files, see
	  below.</p>
      </item>

      <tag><c>{outdir, Dir}, Dir=string()</c></tag>
      <item>
        <p>Destination for generated files. Default is current working
	  directory.</p>
      </item>

      <tag><c>{number, Number}, Number=int()</c></tag>
      <item>
        <p>First chapter number when transforming a <c>chapter</c>
	  file. Default is 1.</p>
      </item>

      <tag><c>{ptype, unix|windows}</c></tag>
      <item>
        <p>For <c>path</c> elements, the specified file path should be
	  presented.</p>
      </item>

      <tag><c>silent</c></tag>
      <item>
        <p>Silent - no warnings, only error information is printed.</p>
      </item>

      <tag><c>{top, Index}, Index=string()</c></tag>
      <item>
	<p>Specifies the value of "Top" in the left frame of a front
	  page, which normally should be some kind of top index file
	  for the documentation.</p>
      </item>

      <tag><c>{vsn, Vsn}, Vsn=string()</c></tag>
      <item>
	<p>Application version number. Overrides a version number
	  defined in the XML document. Visible in the left frame and
	  on the front page.</p>
      </item>

      <tag><c>{term_defs, File}, File=string()</c></tag>
      <item>
        <p>Use the global glossary definitions in <c>File</c>, which
	  should contain a list of tuples <c>{Id, Name, Definition,
	    Owner}</c>. See the section
	  <seealso marker="inline_tags#termTAG">&lt;term&gt;,
	    &lt;termdef&gt; - Glossary</seealso> in the User's Guide.
	</p>
      </item>

      <tag><c>{cite_defs, File}, File=string()</c></tag>
      <item>
        <p>Use the global bibliography definitions in <c>File</c>, which
	  should contain a list of tuples <c>{Id, Title, Info,
	    Owner}</c>. See the section
	  <seealso marker="inline_tags#citeTAG">&lt;cite&gt;,
	    &lt;citedef&gt; - Bibliography</seealso> in the User's
	  Guide.</p>
      </item>
    </taglist>
  </section>

  <section>
    <title>Callback Module</title>

    <p>A <c>html_mod</c> callback module can include the functions
      specified below. Note that there is no check that the resulting
      HTML code is valid. All functions are optional.</p>
  </section>

  <funcs>
    <func>
      <name>Module:head() -> string()</name>
      <fsummary>Snippet to be included in head of a document.</fsummary>
      <desc>
	<p>Defines a HTML snippet to be included in the head of
	  a document, after the <c>&lt;HEAD></c> start tag and
	  <c>&lt;TITLE></c> tag:</p>
	<pre>
&lt;HTML>
&lt;HEAD>
  &lt;TITLE>...&lt;/TITLE>
  - snippet is included here -
  ...
&lt;/HEAD>
...
&lt;/HTML>
	</pre>
      </desc>
    </func>

    <func>
      <name>Module:top() -> string()</name>
      <fsummary>Snippet to be included at the top of a document.
      </fsummary>
      <desc>
	<p>Defines a HTML snippet to be included at the top of a
	  document, after the <c>&lt;BODY></c> start tag.</p>
      </desc>
    </func>

    <func>
      <name>Module:bottom() -> string()</name>
      <fsummary>Snippet to be included at the bottom of a document.
      </fsummary>
      <desc>
	<p>Defines a HTML snippet to be included at the bottom of a
	  document, before the <c>&lt;/BODY></c> end tag.</p>
      </desc>
    </func>

    <func>
      <name>Module:seealso(SeeAlso) -> Href</name>
      <fsummary></fsummary>
      <type>
	<v>SeeAlso = Href = string()</v>
      </type>
      <desc>
	<p>When referring to another part of the document, or another
	  document, the XML tag <c>&lt;seealso&gt;</c> is used:
	  <c><![CDATA[<seealso marker="File#Marker">...text...</seealso>]]></c>.
	  By default, this is translated to
	  <c><![CDATA[<A HREF="File.html#Marker>...text...</A>]]></c>.</p>

	<p>This function makes it possible to specify an alternative
	  translation <c>Href</c> of the <c>marker</c> attribute value
	  <c>SeeAlso</c>. For example, in OTP this is used to resolve
	  cross references between applications.</p>
      </desc>
    </func>
  </funcs>

</erlref>