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: 418346<?xml version="1.0" encoding="UTF-8"?>12<!-- This is an automatically generated file. -->3<Chapter Label="Chapter_AutoDoc">4<Heading>AutoDoc</Heading>56<Section Label="Chapter_AutoDoc_Section_The_AutoDoc_function">7<Heading>The AutoDoc() function</Heading>89<ManSection>10<Func Arg="[package[, optrec ]]" Name="AutoDoc" />11<Returns>nothing12</Returns>13<Description>14This is the main function of the &AutoDoc; package. It can perform15any combination of the following three tasks:16<Enum>17<Item>18It can (re)generate a scaffold for your package manual.19That is, it can produce two XML files in &GAPDoc; format to be used as part20of your manual: First, a file named <F>doc/PACKAGENAME.xml</F>21(with your package's name substituted) which is used as22main XML file for the package manual, i.e. this file sets the23XML doctype and defines various XML entities, includes24other XML files (both those generated by &AutoDoc; as well25as additional files created by other means), tells &GAPDoc;26to generate a table of content and an index, and more.27Secondly, it creates a file <F>doc/title.xml</F> containing a title28page for your documentation, with information about your package29(name, description, version), its authors and more, based30on the data in your <F>PackageInfo.g</F>.31</Item>32<Item>33It can scan your package for &AutoDoc; based documentation (by using &AutoDoc;34tags and the Autodoc command.35This will36produce further XML files to be used as part of the package manual.37</Item>38<Item>39It can use &GAPDoc; to generate PDF, text and HTML (with40MathJaX enabled) documentation from the &GAPDoc; XML files it41generated as well as additional such files provided by you. For42this, it invokes <Ref Func='MakeGAPDocDoc' BookName='gapdoc'/>43to convert the XML sources, and it also instructs &GAPDoc; to copy44supplementary files (such as CSS style files) into your doc directory45(see <Ref Func='CopyHTMLStyleFiles' BookName='gapdoc'/>).46</Item>47</Enum>48For more information and some examples, please refer to Chapter <Ref Label='Tutorials'/>.49<P/>50The parameters have the following meanings:51<List>52<Mark><A>package</A></Mark>53<Item>54This is either the name of package, or an <C>IsDirectory</C> object.55In the former case, &AutoDoc; uses the metadata of the first package56with that name known to &GAP;. In the latter case, it checks whether57the given directory contains a <F>PackageInfo.g</F> file, and extracts58all needed metadata from that. This is for example useful if you have59multiple versions of the package around and want to make sure the60documentation of the correct version is built.61<P/>62If this argument is omitted, &AutoDoc; uses the <C>DirectoryCurrent()</C>.63</Item>64<Mark><A>optrec</A></Mark>65<Item>66<A>optrec</A> can be a record with some additional options.67The following are currently supported:68<List>69<Mark><A>dir</A></Mark>70<Item>71This should be a string containing a (relative) path or a72Directory() object specifying where the package documentation73(i.e. the &GAPDoc; XML files) are stored.74<Br/>75<E>Default value: <C>"doc/"</C>.</E>76</Item>77<Mark><A>scaffold</A></Mark>78<Item>79This controls whether and how to generate scaffold XML files80for the package documentation.81<P/>82The value should be either <K>true</K>, <K>false</K> or a83record. If it is a record or <K>true</K> (the latter is84equivalent to specifying an empty record), then this feature is85enabled. It is also enabled if <A>opt.scaffold</A> is missing but the86package's info record in <F>PackageInfo.g</F> has an <C>AutoDoc</C> entry.87In all other cases (in particular if <A>opt.scaffold</A> is88<K>false</K>), scaffolding is disabled.89<P/>90If scaffolding is enabled, and <A>PackageInfo.AutoDoc</A> exists, then it is91assumed to be a record, and its contents are used as default values for92the scaffold settings.93<P/>94<P/>95If <A>opt.scaffold</A> is a record, it may contain the following entries.96<P/>97<List>98<Mark><A>includes</A></Mark>99<Item>100A list of XML files to be included in the body of the main XML file.101If you specify this list and also are using &AutoDoc; to document102your operations with &AutoDoc; comments,103you can add <F>_AutoDocMainFile.xml</F> to this list104to control at which point the documentation produced by &AutoDoc;105is inserted. If you do not do this, it will be added after the last106of your own XML files.107</Item>108<Mark><A>index</A></Mark>109<Item>110By default, the scaffold creates an index. If you do not want an index,111set this to <K>false</K>.112</Item>113<Mark><A>appendix</A></Mark>114<Item>115This entry is similar to <A>opt.scaffold.includes</A> but is used116to specify files to include after the main body of the manual,117i.e. typically appendices.118</Item>119<Mark><A>bib</A></Mark>120<Item>121The name of a bibliography file, in BibTeX or XML format.122If this key is not set, but there is a file <F>doc/PACKAGENAME.bib</F>123then it is assumed that you want to use this as your bibliography.124</Item>125<Mark><A>entities</A></Mark>126<Item>127A record whose keys are taken as entity names, set to the corresponding128(string) values. For example, if you pass the record <Q>SomePackage</Q>,129<Listing><![CDATA[130rec( SomePackage := "<Package>SomePackage</Package>",131RELEASEYEAR := "2015" )]]></Listing>132then the following entity definitions are added to the XML preamble:133<Listing><![CDATA[<!ENTITY SomePackage '<Package>SomePackage</Package>'>134<!ENTITY RELEASEYEAR '2015'>]]></Listing>135This allows you to write <Q>&SomePackage;</Q> and <Q>&RELEASEYEAR;</Q>136in your documentation, which will be replaced by respective values specified137in the entities definition.138</Item>139<Mark><A>TitlePage</A></Mark>140<Item>141A record whose entries are used to embellish the generated title page142for the package manual with extra information, such as a copyright143statement or acknowledgments. To this end, the names of the record144components are used as XML element names, and the values of the145components are outputted as content of these XML elements. For146example, you could pass the following record to set a custom147acknowledgements text:148<Listing><![CDATA[149rec( Acknowledgements := "Many thanks to ..." )]]></Listing>150For a list of valid entries in the title page, please refer to the151&GAPDoc; manual, specifically section <Ref Subsect='TitlePage' BookName='gapdoc'/>.152</Item>153<Mark><A>MainPage</A></Mark>154<Item>155If scaffolding is enabled, by default a main XML file is generated (this156is the file which contains the XML doctype and more). If you do not157want this (e.g. because you have a handwritten main XML file), but158still want &AutoDoc; to generate a title page for you, you can set this159option to <K>false</K>160</Item>161<Mark><A>document_class</A></Mark>162<Item>163Sets the document class of the resulting PDF. The value can either be a string164which has to be the name of the new document class, a list containing this string, or165a list of two strings. Then the first one has to be the document class name, the second one166the option string ( contained in [ ] ) in LaTeX.167</Item>168<Mark><A>latex_header_file</A></Mark>169<Item>170Replaces the standard header from &GAPDoc; completely with the header in this LaTeX file.171Please be careful here, and look at GAPDoc's latexheader.tex file for an example.172</Item>173<Mark><A>gapdoc_latex_options</A></Mark>174<Item>175Must be a record with entries which can be understood by SetGapDocLaTeXOptions. Each entry can be a string, which176will be given to &GAPDoc; directly, or a list containing of two entries: The first one must be the string "file",177the second one a filename. This file will be read and then its content is passed to &GAPDoc; as option with the name178of the entry.179</Item>180</List>181</Item>182<Mark><A>autodoc</A></Mark>183<Item>184This controls whether and how to generate addition XML documentation files185by scanning for &AutoDoc; documentation comments.186<P/>187The value should be either <K>true</K>, <K>false</K> or a188record. If it is a record or <K>true</K> (the latter is189equivalent to specifying an empty record), then this feature is190enabled. It is also enabled if <A>opt.autodoc</A> is missing but the191package depends (directly) on the &AutoDoc; package.192In all other cases (in particular if <A>opt.autodoc</A> is193<K>false</K>), this feature is disabled.194<P/>195<P/>196If <A>opt.autodoc</A> is a record, it may contain the following entries.197<P/>198<List>199<Mark><A>files</A></Mark>200<Item>201A list of files (given by paths relative to the package directory)202to be scanned for &AutoDoc; documentation comments.203Usually it is more convenient to use <A>autodoc.scan_dirs</A>, see below.204</Item>205<Mark><A>scan_dirs</A></Mark>206<Item>207A list of subdirectories of the package directory (given as relative paths)208which &AutoDoc; then scans for .gi, .gd, .g, and .autodoc files; all of these files209are then scanned for &AutoDoc; documentation comments.210<Br/>211<E>Default value: <C>[ ".", "gap", "lib", "examples", "examples/doc" ]</C>.</E>212</Item>213<Mark><A>level</A></Mark>214<Item>215This defines the level of the created documentation. The default value is 0.216When parts of the manual are declared with a higher value217they will not be printed into the manual.218</Item>219</List>220</Item>221<Mark><A>gapdoc</A></Mark>222<Item>223This controls whether and how to invoke &GAPDoc; to create HTML, PDF and text224files from your various XML files.225<P/>226The value should be either <K>true</K>, <K>false</K> or a227record. If it is a record or <K>true</K> (the latter is228equivalent to specifying an empty record), then this feature is229enabled. It is also enabled if <A>opt.gapdoc</A> is missing.230In all other cases (in particular if <A>opt.gapdoc</A> is231<K>false</K>), this feature is disabled.232<P/>233<P/>234If <A>opt.gapdoc</A> is a record, it may contain the following entries.235<P/>236<List>237<Mark><A>main</A></Mark>238<Item>239The name of the main XML file of the package manual.240This exists primarily to support packages with existing manual241which use a filename here which differs from the default.242In particular, specifying this is unnecessary when using scaffolding.243<Br/>244<E>Default value: <C>PACKAGENAME.xml</C></E>.245</Item>246<Mark><A>files</A></Mark>247<Item>248A list of files (given by paths relative to the package directory)249to be scanned for &GAPDoc; documentation comments.250Usually it is more convenient to use <A>gapdoc.scan_dirs</A>, see below.251</Item>252<Mark><A>scan_dirs</A></Mark>253<Item>254A list of subdirectories of the package directory (given as relative paths)255which &AutoDoc; then scans for .gi, .gd and .g files; all of these files256are then scanned for &GAPDoc; documentation comments.257<Br/>258<E>Default value: <C>[ ".", "gap", "lib", "examples", "examples/doc" ]</C>.</E>259</Item>260<Mark><A>gap_root_relative_path</A></Mark>261<Item>262Either a boolean, or a string containing a relative path.263By default (if this option is not set, or is set to <K>false</K>),264references in the generated documentation referring to external documentation265(such as the GAP manual) are encoded using absolute paths.266This is fine as long as the documentation stays on only a single267computer, but is problematic when preparing documentation that should be268used on multiple computers, e.g., when creating a distribution archive of269a GAP package.<Br/>270Thus, if a relative path is provided via this option (or if it is set to true,271in which case the relative path <F>../../..</F> is used), then &AutoDoc;272and &GAPDoc; attempt to replace all absolute paths in references to GAP273manuals by paths based on this relative path.<P/>274<P/>275On a technical level, &AutoDoc; passes the relative path to the276<A>gaproot</A> parameter of <Ref Func='MakeGAPDocDoc'277BookName='gapdoc'/><P/>278</Item>279</List>280</Item>281<Mark><A>maketest</A></Mark>282<Item>283The maketest item can be true or a record. When it is true,284a simple maketest.g is created in the main package directory,285which can be used to test the examples from the manual. As a record,286the entry can have the following entries itself, to specify some options.287<List>288<Mark>filename</Mark>289<Item>290Sets the name of the test file.291</Item>292<Mark>commands</Mark>293<Item>294A list of strings, each one a command, which295will be executed at the beginning of the test file.296</Item>297</List>298</Item>299</List>300</Item>301</List>302<P/>303</Description>304</ManSection>305306307</Section>308309310<Section Label="Chapter_AutoDoc_Section_Examples">311<Heading>Examples</Heading>312313<P/>314Some basic examples for using <C>AutoDoc</C> were already shown in315Chapter <Ref Label='Tutorials'/>.316</Section>317318319</Chapter>320321322323