Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
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
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1X4 [33X[0;0YAutoDoc[133X[101X234[1X4.1 [33X[0;0YThe AutoDoc() function[133X[101X56[1X4.1-1 AutoDoc[101X78[29X[2XAutoDoc[102X( [[3Xpackage[103X[, [3Xoptrec[103X]] ) [32X function9[6XReturns:[106X [33X[0;10Ynothing[133X1011[33X[0;0YThis is the main function of the [5XAutoDoc[105X package. It can perform any12combination of the following three tasks:[133X1314[31X1[131X [33X[0;6YIt can (re)generate a scaffold for your package manual. That is, it15can produce two XML files in [5XGAPDoc[105X format to be used as part of your16manual: First, a file named [11Xdoc/PACKAGENAME.xml[111X (with your package's17name substituted) which is used as main XML file for the package18manual, i.e. this file sets the XML doctype and defines various XML19entities, includes other XML files (both those generated by [5XAutoDoc[105X as20well as additional files created by other means), tells [5XGAPDoc[105X to21generate a table of content and an index, and more. Secondly, it22creates a file [11Xdoc/title.xml[111X containing a title page for your23documentation, with information about your package (name, description,24version), its authors and more, based on the data in your25[11XPackageInfo.g[111X.[133X2627[31X2[131X [33X[0;6YIt can scan your package for [5XAutoDoc[105X based documentation (by using28[5XAutoDoc[105X tags and the Autodoc command. This will produce further XML29files to be used as part of the package manual.[133X3031[31X3[131X [33X[0;6YIt can use [5XGAPDoc[105X to generate PDF, text and HTML (with MathJaX32enabled) documentation from the [5XGAPDoc[105X XML files it generated as well33as additional such files provided by you. For this, it invokes34[2XMakeGAPDocDoc[102X ([14XGAPDoc: MakeGAPDocDoc[114X) to convert the XML sources, and35it also instructs [5XGAPDoc[105X to copy supplementary files (such as CSS36style files) into your doc directory (see [2XCopyHTMLStyleFiles[102X ([14XGAPDoc:37CopyHTMLStyleFiles[114X)).[133X3839[33X[0;0YFor more information and some examples, please refer to Chapter [14X1[114X.[133X4041[33X[0;0YThe parameters have the following meanings:[133X4243[8X[3Xpackage[103X[108X44[33X[0;6YThis is either the name of package, or an [10XIsDirectory[110X object. In the45former case, [5XAutoDoc[105X uses the metadata of the first package with that46name known to [5XGAP[105X. In the latter case, it checks whether the given47directory contains a [11XPackageInfo.g[111X file, and extracts all needed48metadata from that. This is for example useful if you have multiple49versions of the package around and want to make sure the documentation50of the correct version is built.[133X5152[33X[0;6YIf this argument is omitted, [5XAutoDoc[105X uses the [10XDirectoryCurrent()[110X.[133X5354[8X[3Xoptrec[103X[108X55[33X[0;6Y[3Xoptrec[103X can be a record with some additional options. The following are56currently supported:[133X5758[8X[3Xdir[103X[108X59[33X[0;12YThis should be a string containing a (relative) path or a60Directory() object specifying where the package documentation61(i.e. the [5XGAPDoc[105X XML files) are stored.[133X62[33X[0;12Y[13XDefault value: [10X"doc/"[110X.[113X[133X6364[8X[3Xscaffold[103X[108X65[33X[0;12YThis controls whether and how to generate scaffold XML files for66the package documentation.[133X6768[33X[0;12YThe value should be either [9Xtrue[109X, [9Xfalse[109X or a record. If it is a69record or [9Xtrue[109X (the latter is equivalent to specifying an empty70record), then this feature is enabled. It is also enabled if71[3Xopt.scaffold[103X is missing but the package's info record in72[11XPackageInfo.g[111X has an [10XAutoDoc[110X entry. In all other cases (in73particular if [3Xopt.scaffold[103X is [9Xfalse[109X), scaffolding is disabled.[133X7475[33X[0;12YIf scaffolding is enabled, and [3XPackageInfo.AutoDoc[103X exists, then76it is assumed to be a record, and its contents are used as77default values for the scaffold settings.[133X7879[33X[0;12YIf [3Xopt.scaffold[103X is a record, it may contain the following80entries.[133X8182[8X[3Xincludes[103X[108X83[33X[0;18YA list of XML files to be included in the body of the main84XML file. If you specify this list and also are using85[5XAutoDoc[105X to document your operations with [5XAutoDoc[105X comments,86you can add [11X_AutoDocMainFile.xml[111X to this list to control87at which point the documentation produced by [5XAutoDoc[105X is88inserted. If you do not do this, it will be added after89the last of your own XML files.[133X9091[8X[3Xindex[103X[108X92[33X[0;18YBy default, the scaffold creates an index. If you do not93want an index, set this to [9Xfalse[109X.[133X9495[8X[3Xappendix[103X[108X96[33X[0;18YThis entry is similar to [3Xopt.scaffold.includes[103X but is used97to specify files to include after the main body of the98manual, i.e. typically appendices.[133X99100[8X[3Xbib[103X[108X101[33X[0;18YThe name of a bibliography file, in BibTeX or XML format.102If this key is not set, but there is a file103[11Xdoc/PACKAGENAME.bib[111X then it is assumed that you want to104use this as your bibliography.[133X105106[8X[3Xentities[103X[108X107[33X[0;18YA record whose keys are taken as entity names, set to the108corresponding (string) values. For example, if you pass109the record [21XSomePackage[121X,[133X110111[4X [32X[104X112[4Xrec( SomePackage := "<Package>SomePackage</Package>",[104X113[4XRELEASEYEAR := "2015" )[104X114[4X[32X[104X115116[33X[0;18Ythen the following entity definitions are added to the XML117preamble:[133X118119[4X [32X[104X120[4X<!ENTITY SomePackage '<Package>SomePackage</Package>'>[104X121[4X<!ENTITY RELEASEYEAR '2015'>[104X122[4X[32X[104X123124[33X[0;18YThis allows you to write [21X&SomePackage;[121X and [21X&RELEASEYEAR;[121X125in your documentation, which will be replaced by126respective values specified in the entities definition.[133X127128[8X[3XTitlePage[103X[108X129[33X[0;18YA record whose entries are used to embellish the generated130title page for the package manual with extra information,131such as a copyright statement or acknowledgments. To this132end, the names of the record components are used as XML133element names, and the values of the components are134outputted as content of these XML elements. For example,135you could pass the following record to set a custom136acknowledgements text:[133X137138[4X [32X[104X139[4Xrec( Acknowledgements := "Many thanks to ..." )[104X140[4X[32X[104X141142[33X[0;18YFor a list of valid entries in the title page, please143refer to the [5XGAPDoc[105X manual, specifically section [14X'GAPDoc:144TitlePage'[114X.[133X145146[8X[3XMainPage[103X[108X147[33X[0;18YIf scaffolding is enabled, by default a main XML file is148generated (this is the file which contains the XML doctype149and more). If you do not want this (e.g. because you have150a handwritten main XML file), but still want [5XAutoDoc[105X to151generate a title page for you, you can set this option to152[9Xfalse[109X[133X153154[8X[3Xdocument_class[103X[108X155[33X[0;18YSets the document class of the resulting PDF. The value156can either be a string which has to be the name of the new157document class, a list containing this string, or a list158of two strings. Then the first one has to be the document159class name, the second one the option string ( contained160in [ ] ) in LaTeX.[133X161162[8X[3Xlatex_header_file[103X[108X163[33X[0;18YReplaces the standard header from [5XGAPDoc[105X completely with164the header in this LaTeX file. Please be careful here, and165look at GAPDoc's latexheader.tex file for an example.[133X166167[8X[3Xgapdoc_latex_options[103X[108X168[33X[0;18YMust be a record with entries which can be understood by169SetGapDocLaTeXOptions. Each entry can be a string, which170will be given to [5XGAPDoc[105X directly, or a list containing of171two entries: The first one must be the string "file", the172second one a filename. This file will be read and then its173content is passed to [5XGAPDoc[105X as option with the name of the174entry.[133X175176[8X[3Xautodoc[103X[108X177[33X[0;12YThis controls whether and how to generate addition XML178documentation files by scanning for [5XAutoDoc[105X documentation179comments.[133X180181[33X[0;12YThe value should be either [9Xtrue[109X, [9Xfalse[109X or a record. If it is a182record or [9Xtrue[109X (the latter is equivalent to specifying an empty183record), then this feature is enabled. It is also enabled if184[3Xopt.autodoc[103X is missing but the package depends (directly) on the185[5XAutoDoc[105X package. In all other cases (in particular if186[3Xopt.autodoc[103X is [9Xfalse[109X), this feature is disabled.[133X187188[33X[0;12YIf [3Xopt.autodoc[103X is a record, it may contain the following189entries.[133X190191[8X[3Xfiles[103X[108X192[33X[0;18YA list of files (given by paths relative to the package193directory) to be scanned for [5XAutoDoc[105X documentation194comments. Usually it is more convenient to use195[3Xautodoc.scan_dirs[103X, see below.[133X196197[8X[3Xscan_dirs[103X[108X198[33X[0;18YA list of subdirectories of the package directory (given199as relative paths) which [5XAutoDoc[105X then scans for .gi, .gd,200.g, and .autodoc files; all of these files are then201scanned for [5XAutoDoc[105X documentation comments.[133X202[33X[0;18Y[13XDefault value: [10X[ ".", "gap", "lib", "examples",203"examples/doc" ][110X.[113X[133X204205[8X[3Xlevel[103X[108X206[33X[0;18YThis defines the level of the created documentation. The207default value is 0. When parts of the manual are declared208with a higher value they will not be printed into the209manual.[133X210211[8X[3Xgapdoc[103X[108X212[33X[0;12YThis controls whether and how to invoke [5XGAPDoc[105X to create HTML,213PDF and text files from your various XML files.[133X214215[33X[0;12YThe value should be either [9Xtrue[109X, [9Xfalse[109X or a record. If it is a216record or [9Xtrue[109X (the latter is equivalent to specifying an empty217record), then this feature is enabled. It is also enabled if218[3Xopt.gapdoc[103X is missing. In all other cases (in particular if219[3Xopt.gapdoc[103X is [9Xfalse[109X), this feature is disabled.[133X220221[33X[0;12YIf [3Xopt.gapdoc[103X is a record, it may contain the following entries.[133X222223[8X[3Xmain[103X[108X224[33X[0;18YThe name of the main XML file of the package manual. This225exists primarily to support packages with existing manual226which use a filename here which differs from the default.227In particular, specifying this is unnecessary when using228scaffolding.[133X229[33X[0;18Y[13XDefault value: [10XPACKAGENAME.xml[110X[113X.[133X230231[8X[3Xfiles[103X[108X232[33X[0;18YA list of files (given by paths relative to the package233directory) to be scanned for [5XGAPDoc[105X documentation234comments. Usually it is more convenient to use235[3Xgapdoc.scan_dirs[103X, see below.[133X236237[8X[3Xscan_dirs[103X[108X238[33X[0;18YA list of subdirectories of the package directory (given239as relative paths) which [5XAutoDoc[105X then scans for .gi, .gd240and .g files; all of these files are then scanned for241[5XGAPDoc[105X documentation comments.[133X242[33X[0;18Y[13XDefault value: [10X[ ".", "gap", "lib", "examples",243"examples/doc" ][110X.[113X[133X244245[8X[3Xgap_root_relative_path[103X[108X246[33X[0;18YEither a boolean, or a string containing a relative path.247By default (if this option is not set, or is set to248[9Xfalse[109X), references in the generated documentation249referring to external documentation (such as the GAP250manual) are encoded using absolute paths. This is fine as251long as the documentation stays on only a single computer,252but is problematic when preparing documentation that253should be used on multiple computers, e.g., when creating254a distribution archive of a GAP package.[133X255[33X[0;18YThus, if a relative path is provided via this option (or256if it is set to true, in which case the relative path257[11X../../..[111X is used), then [5XAutoDoc[105X and [5XGAPDoc[105X attempt to258replace all absolute paths in references to GAP manuals by259paths based on this relative path.[133X260261[33X[0;18YOn a technical level, [5XAutoDoc[105X passes the relative path to262the [3Xgaproot[103X parameter of [2XMakeGAPDocDoc[102X ([14XGAPDoc:263MakeGAPDocDoc[114X)[133X264265[8X[3Xmaketest[103X[108X266[33X[0;12YThe maketest item can be true or a record. When it is true, a267simple maketest.g is created in the main package directory,268which can be used to test the examples from the manual. As a269record, the entry can have the following entries itself, to270specify some options.[133X271272[8Xfilename[108X273[33X[0;18YSets the name of the test file.[133X274275[8Xcommands[108X276[33X[0;18YA list of strings, each one a command, which will be277executed at the beginning of the test file.[133X278279280[1X4.2 [33X[0;0YExamples[133X[101X281282[33X[0;0YSome basic examples for using [10XAutoDoc[110X were already shown in Chapter [14X1[114X.[133X283284285286