-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathComments.autodoc
More file actions
173 lines (137 loc) · 6.03 KB
/
Comments.autodoc
File metadata and controls
173 lines (137 loc) · 6.03 KB
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
@Chapter Comments
@ChapterTitle &AutoDoc; documentation comments
You can document declarations of global functions and variables, operations,
attributes etc. by inserting **&AutoDoc; comments** into your sources
before these declarations.
An &AutoDoc; comment always starts with `#!`.
This is also the smallest possible &AutoDoc; command.
If you want your declaration documented, just write
`#!` at the line before the documentation. For example:
@BeginLogSession
#!
DeclareOperation( "AnOperation",
[ IsList ] );
@EndLogSession
This will produce a manual entry for the operation `AnOperation`.
<P/>
Inside of &AutoDoc; comments, **&AutoDoc; commands**
starting with `@` can be used to control the output &AutoDoc; produces.
@Section Declarations
@SectionTitle Documenting declarations
In the bare form above, the manual entry for `AnOperation` will not
contain much more than the name of the operation. In order to change
this, there are several commands you can put into the &AutoDoc; comment
before the declaration. Currently, the following commands are provided:
@InsertChunk documenting_declaration_commands
<Br/> <Br/>
As an example, a full &AutoDoc; comment with all the most common options could
look like this:
@BeginLogSession
#! @Description
#! Computes the list of lists of degrees of ordinary characters
#! associated to the <A>p</A>-blocks of the group <A>G</A>
#! with <A>p</A>-modular character table <A>modtbl</A>
#! and underlying ordinary character table <A>ordtbl</A>.
#! @Returns a list
#! @Arguments modtbl
#! @Group CharacterDegreesOfBlocks
#! @FunctionLabel chardegblocks
#! @ChapterInfo Blocks, Attributes
DeclareAttribute( "CharacterDegreesOfBlocks",
IsBrauerTable );
@EndLogSession
@Section Recognized declarations
@InsertChunk recognized_declarators
Note that in the particular case of `DeclareSynonym`, &AutoDoc; has no way to
infer the argument list, so when documenting such a declaration, you must use
the `@Arguments` command to supply that information.
@Section Others
@SectionTitle Other documentation comments
There are also some commands which can be used in &AutoDoc; comments
that are not associated to any one particular declaration. This is useful for
additional text in your documentation, examples, mathematical chapters, etc..
@InsertChunk other_commands
@EndSection
@InsertChunk titlepage_commands
@Section PlainText
@SectionLabel Plain
@SectionTitle Plain text files
AutoDoc plain text files work exactly like AutoDoc comments, except that the
`#!` is unnecessary at the beginning of a line which should be documented.
Files that have the suffix .autodoc will automatically regarded as plain text files,
while the commands `@AutoDocPlainText` and `@EndAutoDocPlainText`
(<Ref Subsect="Subsection_PlainCommands"/>) mark regions in other files which
should be regarded as plain text &AutoDoc; parts. All commands can be used
in a plain text section of a file, without the leading `#!`.
@Section Groups
@SectionLabel Groups
@SectionTitle Grouping
In &GAPDoc;, it is possible to make groups of ManItems, i.e., when documenting
a function, operation, etc., it is possible to group them into suitable chunks.
This can be particularly useful if there are several definitions of an operation
with several different argument types, all doing more or less the same to the arguments.
Then their manual items can be grouped, sharing the same description and return type information.
Note that it is currently not possible to give a header to the Group in the manual,
but the generated ManItem heading of the first entry will be used.
Note that group names are globally unique throughout the whole manual.
That is, groups with the same name are in fact merged into a single group, even if they
were declared in different source files.
Thus you can have multiple `@BeginGroup/@EndGroup` pairs using the
same group name, in different places, and these all will refer to the same group.
Moreover, this means that you can add items to a group via the `@Group` command
in the &AutoDoc; comment of an arbitrary declaration, at any time.
The following code
@BeginLogSession
#! @BeginGroup Group1
#! @Description
#! First sentence.
DeclareOperation( "FirstOperation", [ IsInt ] );
#! @Description
#! Second sentence.
DeclareOperation( "SecondOperation", [ IsInt, IsGroup ] );
#! @EndGroup
## .. Stuff ..
#! @Description
#! Third sentence.
#! @Group Group1
KeyDependentOperation( "ThirdOperation", IsGroup, IsInt, "prime );
@EndLogSession
produces the following:
<ManSection Label="Group1">
<Oper Arg="arg" Name="FirstOperation" Label="for IsInt"/>
<Oper Arg="arg1,arg2" Name="SecondOperation" Label="for IsInt, IsGroup"/>
<Oper Arg="arg1,arg2" Name="ThirdOperation" Label="for IsGroup, IsInt"/>
<Returns></Returns>
<Description>
First sentence.
Second sentence.
Third sentence.
</Description>
</ManSection>
@Section Level
@SectionLabel Level
Levels can be set to not write certain parts in the manual by default.
Every entry has by default the level 0. The command `@Level` can
be used to set the level of the following part to a higher level, for
example 1, and prevent it from being printed to the manual by default.
However, if one sets the level to a higher value in the autodoc option of
<C>AutoDoc()</C>, the parts will be included in the manual at the specific
place.
@BeginLogSession
#! This text will be printed to the manual.
#! @Level 1
#! This text will be printed to the manual if created with level 1 or higher.
#! @Level 2
#! This text will be printed to the manual if created with level 2 or higher.
#! @ResetLevel
#! This text will be printed to the manual.
@EndLogSession
@Section MarkdownExtension
@SectionTitle Markdown-like formatting of text in &AutoDoc;
&AutoDoc; has some convenient ways to insert special format into text, like
math formulas and lists. The syntax for them are inspired by Markdown and LaTeX,
but do not follow them strictly. Neither are all features of the Markdown
language supported. The following subsections describe the Markdown-like
conventions that may be used.
@InsertChunk markdown_conventions
@EndSection