CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<!-- This is an automatically generated file. -->
4
<Chapter Label="Chapter_AutoDoc">
5
<Heading>AutoDoc</Heading>
6
7
<Section Label="Chapter_AutoDoc_Section_The_AutoDoc_function">
8
<Heading>The AutoDoc() function</Heading>
9
10
<ManSection>
11
<Func Arg="[package[, optrec ]]" Name="AutoDoc" />
12
<Returns>nothing
13
</Returns>
14
<Description>
15
This is the main function of the &AutoDoc; package. It can perform
16
any combination of the following three tasks:
17
<Enum>
18
<Item>
19
It can (re)generate a scaffold for your package manual.
20
That is, it can produce two XML files in &GAPDoc; format to be used as part
21
of your manual: First, a file named <F>doc/PACKAGENAME.xml</F>
22
(with your package's name substituted) which is used as
23
main XML file for the package manual, i.e. this file sets the
24
XML doctype and defines various XML entities, includes
25
other XML files (both those generated by &AutoDoc; as well
26
as additional files created by other means), tells &GAPDoc;
27
to generate a table of content and an index, and more.
28
Secondly, it creates a file <F>doc/title.xml</F> containing a title
29
page for your documentation, with information about your package
30
(name, description, version), its authors and more, based
31
on the data in your <F>PackageInfo.g</F>.
32
</Item>
33
<Item>
34
It can scan your package for &AutoDoc; based documentation (by using &AutoDoc;
35
tags and the Autodoc command.
36
This will
37
produce further XML files to be used as part of the package manual.
38
</Item>
39
<Item>
40
It can use &GAPDoc; to generate PDF, text and HTML (with
41
MathJaX enabled) documentation from the &GAPDoc; XML files it
42
generated as well as additional such files provided by you. For
43
this, it invokes <Ref Func='MakeGAPDocDoc' BookName='gapdoc'/>
44
to convert the XML sources, and it also instructs &GAPDoc; to copy
45
supplementary files (such as CSS style files) into your doc directory
46
(see <Ref Func='CopyHTMLStyleFiles' BookName='gapdoc'/>).
47
</Item>
48
</Enum>
49
For more information and some examples, please refer to Chapter <Ref Label='Tutorials'/>.
50
<P/>
51
The parameters have the following meanings:
52
<List>
53
<Mark><A>package</A></Mark>
54
<Item>
55
This is either the name of package, or an <C>IsDirectory</C> object.
56
In the former case, &AutoDoc; uses the metadata of the first package
57
with that name known to &GAP;. In the latter case, it checks whether
58
the given directory contains a <F>PackageInfo.g</F> file, and extracts
59
all needed metadata from that. This is for example useful if you have
60
multiple versions of the package around and want to make sure the
61
documentation of the correct version is built.
62
<P/>
63
If this argument is omitted, &AutoDoc; uses the <C>DirectoryCurrent()</C>.
64
</Item>
65
<Mark><A>optrec</A></Mark>
66
<Item>
67
<A>optrec</A> can be a record with some additional options.
68
The following are currently supported:
69
<List>
70
<Mark><A>dir</A></Mark>
71
<Item>
72
This should be a string containing a (relative) path or a
73
Directory() object specifying where the package documentation
74
(i.e. the &GAPDoc; XML files) are stored.
75
<Br/>
76
<E>Default value: <C>"doc/"</C>.</E>
77
</Item>
78
<Mark><A>scaffold</A></Mark>
79
<Item>
80
This controls whether and how to generate scaffold XML files
81
for the package documentation.
82
<P/>
83
The value should be either <K>true</K>, <K>false</K> or a
84
record. If it is a record or <K>true</K> (the latter is
85
equivalent to specifying an empty record), then this feature is
86
enabled. It is also enabled if <A>opt.scaffold</A> is missing but the
87
package's info record in <F>PackageInfo.g</F> has an <C>AutoDoc</C> entry.
88
In all other cases (in particular if <A>opt.scaffold</A> is
89
<K>false</K>), scaffolding is disabled.
90
<P/>
91
If scaffolding is enabled, and <A>PackageInfo.AutoDoc</A> exists, then it is
92
assumed to be a record, and its contents are used as default values for
93
the scaffold settings.
94
<P/>
95
<P/>
96
If <A>opt.scaffold</A> is a record, it may contain the following entries.
97
<P/>
98
<List>
99
<Mark><A>includes</A></Mark>
100
<Item>
101
A list of XML files to be included in the body of the main XML file.
102
If you specify this list and also are using &AutoDoc; to document
103
your operations with &AutoDoc; comments,
104
you can add <F>_AutoDocMainFile.xml</F> to this list
105
to control at which point the documentation produced by &AutoDoc;
106
is inserted. If you do not do this, it will be added after the last
107
of your own XML files.
108
</Item>
109
<Mark><A>index</A></Mark>
110
<Item>
111
By default, the scaffold creates an index. If you do not want an index,
112
set this to <K>false</K>.
113
</Item>
114
<Mark><A>appendix</A></Mark>
115
<Item>
116
This entry is similar to <A>opt.scaffold.includes</A> but is used
117
to specify files to include after the main body of the manual,
118
i.e. typically appendices.
119
</Item>
120
<Mark><A>bib</A></Mark>
121
<Item>
122
The name of a bibliography file, in BibTeX or XML format.
123
If this key is not set, but there is a file <F>doc/PACKAGENAME.bib</F>
124
then it is assumed that you want to use this as your bibliography.
125
</Item>
126
<Mark><A>entities</A></Mark>
127
<Item>
128
A record whose keys are taken as entity names, set to the corresponding
129
(string) values. For example, if you pass the record <Q>SomePackage</Q>,
130
<Listing><![CDATA[
131
rec( SomePackage := "<Package>SomePackage</Package>",
132
RELEASEYEAR := "2015" )]]></Listing>
133
then the following entity definitions are added to the XML preamble:
134
<Listing><![CDATA[<!ENTITY SomePackage '<Package>SomePackage</Package>'>
135
<!ENTITY RELEASEYEAR '2015'>]]></Listing>
136
This allows you to write <Q>&amp;SomePackage;</Q> and <Q>&amp;RELEASEYEAR;</Q>
137
in your documentation, which will be replaced by respective values specified
138
in the entities definition.
139
</Item>
140
<Mark><A>TitlePage</A></Mark>
141
<Item>
142
A record whose entries are used to embellish the generated title page
143
for the package manual with extra information, such as a copyright
144
statement or acknowledgments. To this end, the names of the record
145
components are used as XML element names, and the values of the
146
components are outputted as content of these XML elements. For
147
example, you could pass the following record to set a custom
148
acknowledgements text:
149
<Listing><![CDATA[
150
rec( Acknowledgements := "Many thanks to ..." )]]></Listing>
151
For a list of valid entries in the title page, please refer to the
152
&GAPDoc; manual, specifically section <Ref Subsect='TitlePage' BookName='gapdoc'/>.
153
</Item>
154
<Mark><A>MainPage</A></Mark>
155
<Item>
156
If scaffolding is enabled, by default a main XML file is generated (this
157
is the file which contains the XML doctype and more). If you do not
158
want this (e.g. because you have a handwritten main XML file), but
159
still want &AutoDoc; to generate a title page for you, you can set this
160
option to <K>false</K>
161
</Item>
162
<Mark><A>document_class</A></Mark>
163
<Item>
164
Sets the document class of the resulting PDF. The value can either be a string
165
which has to be the name of the new document class, a list containing this string, or
166
a list of two strings. Then the first one has to be the document class name, the second one
167
the option string ( contained in [ ] ) in LaTeX.
168
</Item>
169
<Mark><A>latex_header_file</A></Mark>
170
<Item>
171
Replaces the standard header from &GAPDoc; completely with the header in this LaTeX file.
172
Please be careful here, and look at GAPDoc's latexheader.tex file for an example.
173
</Item>
174
<Mark><A>gapdoc_latex_options</A></Mark>
175
<Item>
176
Must be a record with entries which can be understood by SetGapDocLaTeXOptions. Each entry can be a string, which
177
will be given to &GAPDoc; directly, or a list containing of two entries: The first one must be the string "file",
178
the second one a filename. This file will be read and then its content is passed to &GAPDoc; as option with the name
179
of the entry.
180
</Item>
181
</List>
182
</Item>
183
<Mark><A>autodoc</A></Mark>
184
<Item>
185
This controls whether and how to generate addition XML documentation files
186
by scanning for &AutoDoc; documentation comments.
187
<P/>
188
The value should be either <K>true</K>, <K>false</K> or a
189
record. If it is a record or <K>true</K> (the latter is
190
equivalent to specifying an empty record), then this feature is
191
enabled. It is also enabled if <A>opt.autodoc</A> is missing but the
192
package depends (directly) on the &AutoDoc; package.
193
In all other cases (in particular if <A>opt.autodoc</A> is
194
<K>false</K>), this feature is disabled.
195
<P/>
196
<P/>
197
If <A>opt.autodoc</A> is a record, it may contain the following entries.
198
<P/>
199
<List>
200
<Mark><A>files</A></Mark>
201
<Item>
202
A list of files (given by paths relative to the package directory)
203
to be scanned for &AutoDoc; documentation comments.
204
Usually it is more convenient to use <A>autodoc.scan_dirs</A>, see below.
205
</Item>
206
<Mark><A>scan_dirs</A></Mark>
207
<Item>
208
A list of subdirectories of the package directory (given as relative paths)
209
which &AutoDoc; then scans for .gi, .gd, .g, and .autodoc files; all of these files
210
are then scanned for &AutoDoc; documentation comments.
211
<Br/>
212
<E>Default value: <C>[ ".", "gap", "lib", "examples", "examples/doc" ]</C>.</E>
213
</Item>
214
<Mark><A>level</A></Mark>
215
<Item>
216
This defines the level of the created documentation. The default value is 0.
217
When parts of the manual are declared with a higher value
218
they will not be printed into the manual.
219
</Item>
220
</List>
221
</Item>
222
<Mark><A>gapdoc</A></Mark>
223
<Item>
224
This controls whether and how to invoke &GAPDoc; to create HTML, PDF and text
225
files from your various XML files.
226
<P/>
227
The value should be either <K>true</K>, <K>false</K> or a
228
record. If it is a record or <K>true</K> (the latter is
229
equivalent to specifying an empty record), then this feature is
230
enabled. It is also enabled if <A>opt.gapdoc</A> is missing.
231
In all other cases (in particular if <A>opt.gapdoc</A> is
232
<K>false</K>), this feature is disabled.
233
<P/>
234
<P/>
235
If <A>opt.gapdoc</A> is a record, it may contain the following entries.
236
<P/>
237
<List>
238
<Mark><A>main</A></Mark>
239
<Item>
240
The name of the main XML file of the package manual.
241
This exists primarily to support packages with existing manual
242
which use a filename here which differs from the default.
243
In particular, specifying this is unnecessary when using scaffolding.
244
<Br/>
245
<E>Default value: <C>PACKAGENAME.xml</C></E>.
246
</Item>
247
<Mark><A>files</A></Mark>
248
<Item>
249
A list of files (given by paths relative to the package directory)
250
to be scanned for &GAPDoc; documentation comments.
251
Usually it is more convenient to use <A>gapdoc.scan_dirs</A>, see below.
252
</Item>
253
<Mark><A>scan_dirs</A></Mark>
254
<Item>
255
A list of subdirectories of the package directory (given as relative paths)
256
which &AutoDoc; then scans for .gi, .gd and .g files; all of these files
257
are then scanned for &GAPDoc; documentation comments.
258
<Br/>
259
<E>Default value: <C>[ ".", "gap", "lib", "examples", "examples/doc" ]</C>.</E>
260
</Item>
261
<Mark><A>gap_root_relative_path</A></Mark>
262
<Item>
263
Either a boolean, or a string containing a relative path.
264
By default (if this option is not set, or is set to <K>false</K>),
265
references in the generated documentation referring to external documentation
266
(such as the GAP manual) are encoded using absolute paths.
267
This is fine as long as the documentation stays on only a single
268
computer, but is problematic when preparing documentation that should be
269
used on multiple computers, e.g., when creating a distribution archive of
270
a GAP package.<Br/>
271
Thus, if a relative path is provided via this option (or if it is set to true,
272
in which case the relative path <F>../../..</F> is used), then &AutoDoc;
273
and &GAPDoc; attempt to replace all absolute paths in references to GAP
274
manuals by paths based on this relative path.<P/>
275
<P/>
276
On a technical level, &AutoDoc; passes the relative path to the
277
<A>gaproot</A> parameter of <Ref Func='MakeGAPDocDoc'
278
BookName='gapdoc'/><P/>
279
</Item>
280
</List>
281
</Item>
282
<Mark><A>maketest</A></Mark>
283
<Item>
284
The maketest item can be true or a record. When it is true,
285
a simple maketest.g is created in the main package directory,
286
which can be used to test the examples from the manual. As a record,
287
the entry can have the following entries itself, to specify some options.
288
<List>
289
<Mark>filename</Mark>
290
<Item>
291
Sets the name of the test file.
292
</Item>
293
<Mark>commands</Mark>
294
<Item>
295
A list of strings, each one a command, which
296
will be executed at the beginning of the test file.
297
</Item>
298
</List>
299
</Item>
300
</List>
301
</Item>
302
</List>
303
<P/>
304
</Description>
305
</ManSection>
306
307
308
</Section>
309
310
311
<Section Label="Chapter_AutoDoc_Section_Examples">
312
<Heading>Examples</Heading>
313
314
<P/>
315
Some basic examples for using <C>AutoDoc</C> were already shown in
316
Chapter <Ref Label='Tutorials'/>.
317
</Section>
318
319
320
</Chapter>
321
322
323