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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766
|
<Chapter Label="Comments">
<Heading>&AutoDoc; documentation comments</Heading>
You can document declarations of global functions and variables, operations,
attributes etc. by inserting <E>&AutoDoc;</E> comments into your sources before these declaration.
An &AutoDoc; comment always starts with <C>#!</C>.
This is also the smallest possible &AutoDoc; command.
If you want your declaration documented, just write
<C>#!</C> at the line before the documentation. For example:
<Listing><![CDATA[
#!
DeclareOperation( "AnOperation",
[ IsList ] );
]]></Listing>
This will produce a manual entry for the operation <C>AnOperation</C>.
<P/>
Inside of &AutoDoc; comments, <E>&AutoDoc; commands</E>
starting with <C>@</C> can be used to control the output &AutoDoc; produces.
<Section>
<Heading>Documenting declarations</Heading>
In the bare form above, the manual entry for <C>AnOperation</C> 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:
<Subsection Label="@Description">
<Index Key="@Description"><C>@Description <A>descr</A></C></Index>
<Heading><C>@Description <A>descr</A></C></Heading>
Adds the text in the following lines of the &AutoDoc; to the description
of the declaration in the manual. Lines are until the next &AutoDoc; command
or until the declaration is reached.
</Subsection>
<Subsection Label="@Returns">
<Index Key="@Returns"><C>@Returns <A>ret_val</A></C></Index>
<Heading><C>@Returns <A>ret_val</A></C></Heading>
The string <A>ret_val</A> is added to the documentation, with the text <Q>Returns: </Q>
put in front of it. This should usually give a brief hint about the type or meaning
of the value returned by the documented function.
</Subsection>
<Subsection Label="@Arguments">
<Index Key="@Arguments"><C>@Arguments <A>args</A></C></Index>
<Heading><C>@Arguments <A>args</A></C></Heading>
The string <A>args</A> contains a description of the arguments the
function expects, including optional parts, which are denoted by square
brackets. The argument names can be separated by whitespace, commas or
square brackets for the optional arguments, like <Q>grp[, elm]</Q> or
<Q>xx[y[z] ]</Q>. If &GAP; options are used, this can be followed by a colon :
and one or more assignments, like <Q>n[, r]: tries := 100</Q>.
</Subsection>
<Subsection Label="@Group">
<Index Key="@Group"><C>@Group <A>grpname</A></C></Index>
<Heading><C>@Group <A>grpname</A></C></Heading>
Adds the following method to a group with the given name.
See section <Ref Sect="Groups"/> for more information about groups.
</Subsection>
<Subsection Label="@Label">
<Index Key="@Label"><C>@Label <A>label</A></C></Index>
<Heading><C>@Label <A>label</A></C></Heading>
Adds label to the function as label.
If this is not specified, then for declarations that involve a list of input filters
(as is the case for <C>DeclareOperation</C>, <C>DeclareAttribute</C>, etc.),
a default label is generated from this filter list.
</Subsection>
<Listing><![CDATA[
#! @Label testlabel
DeclareProperty( "AProperty",
IsObject );
]]></Listing>
leads to this:
<ManSection>
<Prop Arg="arg" Name="AProperty" Label="testlabel"/>
<Returns> <K>true</K> or <K>false</K>
</Returns>
<Description>
</Description>
</ManSection>
while
<Listing><![CDATA[
#!
DeclareProperty( "AProperty",
IsObject );
]]></Listing>
leads to this:
<ManSection>
<Prop Arg="arg" Name="AProperty" Label="for IsObject"/>
<Returns> <K>true</K> or <K>false</K>
</Returns>
<Description>
</Description>
</ManSection>
<Subsection Label="@ChapterInfo">
<Index Key="@ChapterInfo"><C>@ChapterInfo</C></Index>
<Heading><C>@ChapterInfo <A>chapter</A>, <A>section</A></C></Heading>
Adds the entry to the given chapter and section. Here,
<A>chapter</A> and <A>section</A> are the respective
titles.
</Subsection>
As an example, a full &AutoDoc; comment with all options could look like this:
<Listing><![CDATA[
#! @Description
#! Computes the list of lists of degrees of ordinary characters
#! associated to the $p$-blocks of the group $G$
#! with $p$-modular character table <A>modtbl</A>
#! and underlying ordinary character table `ordtbl`.
#! @Returns a list
#! @Arguments modtbl
#! @Group CharacterDegreesOfBlocks
#! @Label chardegblocks
#! @ChapterInfo Blocks, Attributes
DeclareAttribute( "CharacterDegreesOfBlocks",
IsBrauerTable );
]]></Listing>
</Section>
<Section>
<Heading>Other documentation comments</Heading>
There are also some commands which can be used in &AutoDoc; comments
that are not associated to any declaration. This is useful for additional
text in your documentation, examples, mathematical chapters, etc..
<Subsection Label="@Chapter">
<Index Key="@Chapter"><C>@Chapter</C></Index>
<Index Key="@ChapterLabel"><C>@ChapterLabel</C></Index>
<Index Key="@ChapterTitle"><C>@ChapterTitle</C></Index>
<Heading><C>@Chapter <A>name</A></C></Heading>
Sets the active chapter, all subsequent functions which do not have an explicit chapter
declared in their &AutoDoc; comment via <C>@ChapterInfo</C> will be added to this chapter.
Also all text comments, i.e. lines that begin with #! without a command, and which do not
follow after <C>@Description</C>, will be added to the chapter as regular text. Additionally,
the chapters label will be set to <C>Chapter_</C><A>name</A>.
Example:
<Listing><![CDATA[
#! @Chapter My chapter
#! This is my chapter.
#! I document my stuff in it.
]]></Listing>
The <C>@ChapterLabel</C> <A>label</A> command
can be used to set the label of the chapter to <C>Chapter_</C><A>label</A> instead of
<C>Chapter_</C><A>name</A>.
Additionally, the chapter will be stored as <C>_Chapter_</C><A>label</A><C>.xml</C>.
The <C>@ChapterTitle</C> <A>title</A> command
can be used to set a heading for the chapter that is different from <A>name</A>.
Note that the title does not affect the label.
If you use all three commands, i.e.,
<Listing><![CDATA[
#! @Chapter name
#! @ChapterLabel label
#! @ChapterTitle title
]]></Listing>
<C>title</C> is used for the headline, <C>label</C> for cross-referencing, and <C>name</C>
for setting the same chapter as active chapter again.
</Subsection>
<Subsection Label="@Section">
<Index Key="@Section"><C>@Section</C></Index>
<Index Key="@SectionLabel"><C>@SectionLabel</C></Index>
<Index Key="@SectionTitle"><C>@SectionTitle</C></Index>
<Heading><C>@Section <A>name</A></C></Heading>
Sets an active section like <C>@Chapter</C> sets an active chapter.
The section automatically ends with the next <C>@Section</C> or <C>@Chapter</C> command.
<Listing><![CDATA[
#! @Section My first manual section
#! In this section I am going to document my first method.
]]></Listing>
The <C>@SectionLabel</C> <A>label</A> command
can be used to set the label of the section to <C>Section_</C><A>label</A> instead of
<C>Chapter_chaptername_Section_</C><A>name</A>.
The <C>@SectionTitle</C> <A>title</A> command
can be used to set a heading for the section that is different from <A>name</A>.
</Subsection>
<Subsection Label="@Subsection">
<Index Key="@Subsection"><C>@Subsection</C></Index>
<Index Key="@SubsectionLabel"><C>@SubsectionLabel</C></Index>
<Index Key="@SubsectionTitle"><C>@SubsectionTitle</C></Index>
<Heading><C>@Subsection <A>name</A></C></Heading>
Sets an active subsection like <C>@Section</C> sets an active section.
The subsection automatically ends with the next <C>@Subsection</C>,
<C>@Section</C> or <C>@Chapter</C> command. It also ends with the
next documented function. Indeed, internally each function <Q>manpage</Q>
is treated like a subsection.
<Listing><![CDATA[
#! @Subsection My first manual subsection
#! In this subsection I am going to document my first example.
]]></Listing>
The <C>@SubsectionLabel</C> <A>label</A> command
can be used to set the label of the subsection to <C>Subsection_</C><A>label</A> instead of
<C>Chapter_chaptername_Section_sectionname_Subsection_</C><A>name</A>.
The <C>@SubsectionTitle</C> <A>title</A> command
can be used to set a heading for the subsection that is different from <A>name</A>.
</Subsection>
<Subsection Label="@BeginGroup">
<Index Key="@BeginGroup"><C>@BeginGroup</C></Index>
<Heading><C>@BeginGroup <A>[grpname]</A></C></Heading>
Starts a group. All following documented declarations without an
explicit <C>@Group</C> command are grouped together in the same group
with the given name. If no name is given, then a new nameless group is
generated.
The effect of this command is ended when an <C>@EndGroup</C> command
is reached.
<P/>
See section <Ref Sect="Groups"/> for more information about groups.
</Subsection>
<Subsection Label="@EndGroup">
<Index Key="@EndGroup"><C>@EndGroup</C></Index>
<Heading><C>@EndGroup</C></Heading>
Ends the current group.
<Listing><![CDATA[
#! @BeginGroup MyGroup
#!
DeclareAttribute( "GroupedAttribute",
IsList );
DeclareOperation( "NonGroupedOperation",
[ IsObject ] );
#!
DeclareOperation( "GroupedOperation",
[ IsList, IsRubbish ] );
#! @EndGroup
]]></Listing>
</Subsection>
<Subsection Label="@GroupTitle">
<Index Key="@GroupTitle"><C>@GroupTitle</C></Index>
<Heading>@GroupTitle <A>title</A></Heading>
Sets the subsection heading for the current group to <A>title</A>. In the
absence of any <C>@GroupTitle</C> command, the heading will be the name of the
first entry in the group. See <Ref Sect="Groups" /> for more information.
</Subsection>
<Subsection Label="@Level">
<Index Key="@Level"><C>@Level</C></Index>
<Heading><C>@Level <A>lvl</A></C></Heading>
Sets the current level of the documentation. All items created after this,
chapters, sections, and items, are given the level <A>lvl</A>,
until the <C>@ResetLevel</C> command resets the level to 0 or another level
is set.
<P/>
See section <Ref Sect="Level"/> for more information about levels.
</Subsection>
<Subsection Label="@ResetLevel">
<Index Key="@ResetLevel"><C>@ResetLevel</C></Index>
<Heading><C>@ResetLevel</C></Heading>
Resets the current level to 0.
<P/>
</Subsection>
<Subsection Label="@BeginExample">
<Index Key="@BeginExample"><C>@BeginExample</C></Index>
<Index Key="@EndExample"><C>@EndExample</C></Index>
<Heading><C>@BeginExample</C> and <C>@EndExample</C></Heading>
<C>@BeginExample</C> marks the start of an example to be put into the manual.
It differs from &GAPDoc;'s <C><Example></C> (see <Ref Subsect="Log" BookName="gapdoc"/>),
in that it expects actual code (not in a comment) interspersed with comments,
to allow for examples files that can be both executed by &GAP;, and parsed
by &AutoDoc;. To achieve this, &GAP; commands are not preceded by a comment,
while output has to be preceded by an &AutoDoc; comment.
The <C>gap></C> prompt for the display in the manual is added by &AutoDoc;.
<C>@EndExample</C> ends the example block.
<P/>
To illustrate this command, consider this input:
<Listing><![CDATA[
#! @BeginExample
S5 := SymmetricGroup(5);
#! Sym( [ 1 .. 5 ] )
Order(S5);
#! 120
#! @EndExample
]]></Listing>
This results in the following output:
<Example>
gap> S5 := SymmetricGroup(5);
Sym( [ 1 .. 5 ] )
gap> Order(S5);
120
</Example>
The &AutoDoc; command <C>@Example</C> is an alias of <C>@BeginExample</C>.
</Subsection>
<Subsection Label="@BeginExampleSession">
<Index Key="@BeginExampleSession"><C>@BeginExampleSession</C></Index>
<Index Key="@EndExampleSession"><C>@EndExampleSession</C></Index>
<Heading><C>@BeginExampleSession</C> and <C>@EndExampleSession</C></Heading>
<C>@BeginExampleSession</C> marks the start of an example to be put into the manual,
while <C>@EndExampleSession</C> ends the example block.
It is the direct analog of &GAPDoc;'s <C><Example></C> (see <Ref Subsect="Log" BookName="gapdoc"/>).
<P/>
To illustrate this command, consider this input:
<Listing><![CDATA[
#! @BeginExampleSession
#! gap> S5 := SymmetricGroup(5);
#! Sym( [ 1 .. 5 ] )
#! gap> Order(S5);
#! 120
#! @EndExampleSession
]]></Listing>
This results in the following output:
<Example>
gap> S5 := SymmetricGroup(5);
Sym( [ 1 .. 5 ] )
gap> Order(S5);
120
</Example>
It inserts an example into the manual just as <C>@Example</C> would do, but all lines are commented
and therefore not executed when the file is read.
All lines that should be part of the example displayed in the manual
have to start with an &AutoDoc; comment (<C>#!</C>).
The comment will be removed, and, if the following character is a space,
this space will also be removed. There is never more than one space removed.
To ensure examples are correctly colored in the manual,
there should be exactly one space between <C>#!</C> and the <C>gap></C> prompt.
The &AutoDoc; command <C>@ExampleSession</C> is an alias of <C>@BeginExampleSession</C>.
</Subsection>
<Subsection Label="@BeginLog">
<Index Key="@BeginLog"><C>@BeginLog</C></Index>
<Index Key="@EndLog"><C>@EndLog</C></Index>
<Heading><C>@BeginLog</C> and <C>@EndLog</C></Heading>
Works just like the <C>@BeginExample</C> command, but the example
will not be tested. See the &GAPDoc; manual for more information.
The &AutoDoc; command <C>@Log</C> is an alias of <C>@BeginLog</C>.
</Subsection>
<Subsection Label="@BeginLogSession">
<Index Key="@BeginLogSession"><C>@BeginLogSession</C></Index>
<Index Key="@EndLogSession"><C>@EndLogSession</C></Index>
<Heading><C>@BeginLogSession</C> and <C>@EndLogSession</C></Heading>
Works just like the <C>@BeginExampleSession</C> command, but the example
will not be tested if manual examples are run. It is the direct analog of
&GAPDoc;'s <C><Log></C> (see <Ref Subsect="Log" BookName="gapdoc"/>).
The &AutoDoc; command <C>@LogSession</C> is an alias of <C>@BeginLogSession</C>.
</Subsection>
<Subsection Label="@DoNotReadRestOfFile">
<Index Key="@DoNotReadRestOfFile"><C>@DoNotReadRestOfFile</C></Index>
<Heading><C>@DoNotReadRestOfFile</C></Heading>
Prevents the rest of the file from being read by the parser. Useful for
unfinished or temporary files.
<Listing><![CDATA[
#! This will appear in the manual
#! @DoNotReadRestOfFile
#! This will not appear in the manual.
]]></Listing>
</Subsection>
<Subsection Label="@BeginChunk">
<Index Key="@BeginChunk"><C>@BeginChunk <A>name</A></C></Index>
<Index Key="@EndChunk"><C>@EndChunk</C></Index>
<Index Key="@EndChunk"><C>@InsertChunk <A>name</A></C></Index>
<Heading><C>@BeginChunk <A>name</A></C>, <C>@EndChunk</C>, and <C>@InsertChunk <A>name</A></C></Heading>
Text inside a <C>@BeginChunk</C> / <C>@EndChunk</C> part will not be inserted into
the final documentation directly. Instead, the text is stored in an internal buffer.
That chunk of text can then later on be inserted in any other place by using the
<C>@InsertChunk <A>name</A></C> command.
If you do not provide an <C>@EndChunk</C>, the chunk ends at the end of the file.
<Listing><![CDATA[
#! @BeginChunk MyChunk
#! Hello, world.
#! @EndChunk
#! @InsertChunk MyChunk
## The text "Hello, world." is inserted right before this.
]]></Listing>
You can use this to define an example like this in one file:
<Listing><![CDATA[
#! @BeginChunk Example_Symmetric_Group
#! @BeginExample
S5 := SymmetricGroup(5);
#! Sym( [ 1 .. 5 ] )
Order(S5);
#! 120
#! @EndExample
#! @EndChunk
]]></Listing>
And then later, insert the example in a different file, like this:
<Listing><![CDATA[
#! @InsertChunk Example_Symmetric_Group
]]></Listing>
</Subsection>
<Subsection Label="@BeginCode">
<Index Key="@BeginCode"><C>@BeginCode <A>name</A></C></Index>
<Index Key="@EndCode"><C>@EndCode</C></Index>
<Index Key="@InsertCode"><C>@InsertCode <A>name</A></C></Index>
<Heading><C>@BeginCode <A>name</A></C>, @EndCode, and <C>@InsertCode <A>name</A></C></Heading>
Inserts the text between <C>@BeginCode</C> and <C>@EndCode</C> verbatim at the point where
<C>@InsertCode</C> is called. This is useful to insert code excerpts
directly into the manual.
<Listing><![CDATA[
#! @BeginCode Increment
i := i + 1;
#! @EndCode
#! @InsertCode Increment
## Code is inserted here.
]]></Listing>
</Subsection>
<Subsection Label="@LatexOnly">
<Index Key="@LatexOnly"><C>@LatexOnly <A>text</A></C></Index>
<Index Key="@BeginLatexOnly"><C>@BeginLatexOnly</C></Index>
<Index Key="@EndLatexOnly"><C>@EndLatexOnly</C></Index>
<Heading><C>@LatexOnly <A>text</A></C>, <C>@BeginLatexOnly</C>, and <C>@EndLatexOnly</C></Heading>
Code inserted between <C>@BeginLatexOnly</C> and <C>@EndLatexOnly</C> or after <C>@LatexOnly</C> is only inserted
in the PDF version of the manual or worksheet. It can hold arbitrary &LaTeX;-commands.
<Listing><![CDATA[
#! @BeginLatexOnly
#! \include{picture.tex}
#! @EndLatexOnly
#! @LatexOnly \include{picture.tex}
]]></Listing>
</Subsection>
<Subsection Label="@NotLatex">
<Index Key="@NotLatex"><C>@NotLatex <A>text</A></C></Index>
<Index Key="@BeginNotLatex"><C>@BeginNotLatex</C></Index>
<Index Key="@EndNotLatex"><C>@EndNotLatex</C></Index>
<Heading><C>@NotLatex <A>text</A></C>, <C>@BeginNotLatex</C>, and <C>@EndNotLatex</C></Heading>
Code inserted between <C>@BeginNotLatex</C> and <C>@EndNotLatex</C> or after <C>@NotLatex</C> is inserted
in the HTML and text versions of the manual or worksheet, but not in the PDF version.
<Listing><![CDATA[
#! @BeginNotLatex
#! For further information see the PDF version of this manual.
#! @EndNotLatex
#! @NotLatex For further information see the PDF version of this manual.
]]></Listing>
</Subsection>
</Section>
<Section Label="TitlepageCommands">
<Heading>Title page commands</Heading>
The following commands can be used to add the corresponding parts to the title page of
the document which generated by &AutoDoc; if scaffolding is enabled.
<List>
<Item>
<C>@Title</C>
</Item>
<Item>
<C>@Subtitle</C>
</Item>
<Item>
<C>@Version</C>
</Item>
<Item>
<C>@TitleComment</C>
</Item>
<Item>
<C>@Author</C>
</Item>
<Item>
<C>@Date</C>
</Item>
<Item>
<C>@Address</C>
</Item>
<Item>
<C>@Abstract</C>
</Item>
<Item>
<C>@Copyright</C>
</Item>
<Item>
<C>@Acknowledgements</C>
</Item>
<Item>
<C>@Colophon</C>
</Item>
</List>
Those add the following lines at the corresponding point of the title page. Please note that many of those
things can be (better) extracted from the <F>PackageInfo.g</F>. In case you set some of those,
the extracted or in scaffold defined items will be overwritten. While this is not very useful for
documenting packages, they are necessary for worksheets created with <Ref Func="AutoDocWorksheet"/>,
since worksheets do not have a <F>PackageInfo.g</F> file from which this information could be extracted.
</Section>
<Section Label="PlainText">
<Heading>Plain text files</Heading>
Files that have the suffix <C>.autodoc</C> and are listed in the
<C>autodoc.files</C> option of <Ref Func="AutoDoc"/>, resp. are contained in
one of the directories listed in <C>autodoc.scan_dirs</C>, are treated as
&AutoDoc; plain text files. These work exactly like &AutoDoc; comments, except
that lines do not need to (and in fact, should not) start with <C>#!</C>.
</Section>
<Section Label="Groups">
<Heading>Grouping</Heading>
In &GAPDoc;, it is possible to make groups of manual items, 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.
You can give a heading to the group in the manual with the <C>@GroupTitle</C>
command; if that is not supplied, then the heading of the first manual item
in the group will be used as the heading.
<P/>
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 <C>@BeginGroup</C> / <C>@EndGroup</C> pairs using the
same group name, in different places, and these all will refer to the same group.
<P/>
Moreover, this means that you can add items to a group via the <C>@Group</C> command
in the &AutoDoc; comment of an arbitrary declaration, at any time.
<P/>
The following code
<Listing><![CDATA[
#! @BeginGroup Group1
#! @GroupTitle A family of operations
#! @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 );
]]></Listing>
produces the following:
<ManSection Label="Group1">
<Heading>A family of operations</Heading>
<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"/>
<Description>
First sentence.
Second sentence.
Third sentence.
</Description>
</ManSection>
</Section>
<Section Label="Level">
<Heading>Level</Heading>
Levels can be set to not write certain parts in the manual by default.
Every entry has by default the level 0. The command <C>@Level</C> 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
&AutoDoc;, the parts will be included in the manual at the specific place.
<Listing><![CDATA[
#! 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.
]]></Listing>
</Section>
<Section Label="MarkdownExtension">
<Heading>Markdown-like formatting of text in &AutoDoc;</Heading>
&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 what is possible.
<Subsection Label="MarkdownExtensionList">
<Heading>Lists</Heading>
One can create lists of items by beginning a new line with *, +, -, followed by one
space. The first item starts the list. When items are longer than one line, the following lines
have to be indented by at least two spaces. The list ends when a line which does not start a new
item is not indented by two spaces. Of course lists can be nested. Here is an example:
<Listing><![CDATA[
#! The list starts in the next line
#! * item 1
#! * item 2
#! which is a bit longer
#! * and also contains a nested list
#! * with two items
#! * item 3 of the outer list
#! This does not belong to the list anymore.
]]></Listing>
This is the output:<Br/>
The list starts in the next line
<List>
<Item>
item 1
</Item>
<Item>
item 2
which is a bit longer
<List>
<Item>
and also contains a nested list
</Item>
<Item>
with two items
</Item>
</List>
</Item>
<Item>
item 3 of the outer list
</Item>
</List>
This does not belong to the list anymore.<Br/>
The *, -, and + are fully interchangeable and can even be used mixed, but this is not recommended.
</Subsection>
<Subsection Label="MarkdownExtensionMath">
<Heading>Math modes</Heading>
One can start an inline formula with a $, and also end it with $, just like in &LaTeX;. This will translate into
&GAPDoc;s inline math environment. For display mode one can use $$, also like &LaTeX;.
<Listing><![CDATA[
#! This is an inline formula: $1+1 = 2$.
#! This is a display formula:
#! $$ \sum_{i=1}^n i. $$
]]></Listing>
produces the following output:<Br/>
This is an inline formula: <Math>1+1 = 2</Math>.
This is a display formula:
<Display> \sum_{i=1}^n i. </Display>
</Subsection>
<Subsection Label="MarkdownExtensionEmph">
<Heading>Emphasize</Heading>
One can emphasize text by using two asterisks (**) or two underscores (__) at the
beginning and the end of the text which should be emphasized. Example:
<Listing><![CDATA[
#! **This** is very important.
#! This is __also important__.
#! **Naturally, more than one line
#! can be important.**
]]></Listing>
This produces the following output:<Br/>
<E>This</E> is very important.
This is <E>also important</E>.
<E>Naturally, more than one line
can be important.</E>
</Subsection>
<Subsection Label="MarkdownExtensionInlineCode">
<Heading>Inline code</Heading>
One can mark inline code snippets by using backticks (`) at the
beginning and the end of the text which should be marked as code. Example:
<Listing><![CDATA[
#! Call function `foobar()` at the start.
]]></Listing>
This produces the following output:<Br/>
Call function <C>foobar()</C> at the start.
</Subsection>
</Section>
<Section Label="Deprecated">
<Heading>Deprecated commands</Heading>
The following commands used to be supported, but should not generally be used anymore.
They will be removed in a future version of &AutoDoc;.
<List>
<Mark><C>@EndSection</C></Mark>
<Item>You can simply remove any use of this, &AutoDoc; ends sections automatically
at the start of any new section or chapter.</Item>
<Mark><C>@EndSubsection</C></Mark>
<Item>You can simply remove any use of this, &AutoDoc; ends subsections automatically
at the start of any new subsection, section or chapter.</Item>
<Mark><C>@BeginAutoDoc</C> and <C>@EndAutoDoc</C></Mark>
<Item>It suffices to prepend each declaration that is meant to be appear in the
manual with a minimal &AutoDoc; comment <C>#!</C>.</Item>
<Mark><C>@BeginSystem <A>name</A></C>, <C>@EndSystem</C>, and <C>@InsertSystem <A>name</A></C></Mark>
<Item>Please use the chunk commands from subsection <Ref Subsect="@BeginChunk"/> instead.</Item>
<Mark><C>@AutoDocPlainText</C> and <C>@EndAutoDocPlainText</C></Mark>
<Item>Use <C>.autodoc</C> files or &AutoDoc; comments instead.</Item>
</List>
</Section>
</Chapter>
|