<!--Weave of 'What This Module Does' generated by Inweb-->
<divclass="breadcrumbs">
<ulclass="crumbs"><li><ahref="../index.html">Home</a></li><li><ahref="../compiler.html">Inter Modules</a></li><li><ahref="index.html">index</a></li><li><ahref="index.html#P">Preliminaries</a></li><li><b>What This Module Does</b></li></ul></div>
<pclass="purpose">An overview of the index module's role and abilities.</p>
<ulclass="toc"><li><ahref="P-wtmd.html#SP1">§1. Prerequisites</a></li><li><ahref="P-wtmd.html#SP2">§2. The Index</a></li><li><ahref="P-wtmd.html#SP4">§4. Localisation</a></li></ul><hrclass="tocbar">
<pclass="commentary firstcommentary"><aid="SP1"class="paragraph-anchor"></a><b>§1. Prerequisites. </b>The index module is a part of the Inform compiler toolset. It is
presented as a literate program or "web". Before diving in:
</p>
<ulclass="items"><li>(a) It helps to have some experience of reading webs: see <ahref="../../../inweb/docs/index.html"class="internal">inweb</a> for more.
</li><li>(b) The module is written in C, in fact ANSI C99, but this is disguised by the
fact that it uses some extension syntaxes provided by the <ahref="../../../inweb/docs/index.html"class="internal">inweb</a> literate
programming tool, making it a dialect of C called InC. See <ahref="../../../inweb/docs/index.html"class="internal">inweb</a> for
full details, but essentially: it's C without predeclarations or header files,
and where functions have names like <spanclass="extract"><spanclass="extract-syntax">Tags::add_by_name</span></span> rather than just <spanclass="extract"><spanclass="extract-syntax">add_by_name</span></span>.
</li><li>(c) This module uses other modules drawn from the <ahref="../compiler.html"class="internal">compiler</a>, and also
uses a module of utility functions called <ahref="../../../inweb/docs/foundation-module/index.html"class="internal">foundation</a>.
For more, see <ahref="../../../inweb/docs/foundation-module/P-abgtf.html"class="internal">A Brief Guide to Foundation (in foundation)</a>.
</li></ul>
<pclass="commentary firstcommentary"><aid="SP2"class="paragraph-anchor"></a><b>§2. The Index. </b>All users of the Inform GUI app are familiar with the Index: it's a sort of
mini-website giving a detailed picture of the content of the story being
created. In the current design, there are seven colour-coded "pages", each
divided up into two or more parts called "elements".
</p>
<pclass="commentary">In fact, this is only one of the possible "index products". It's also possible
to generate an EPS (encapsulated PostScript) file of a spatial map, for example.
</p>
<pclass="commentary">Until 2021 the Index for a project was generated by the main <ahref="../inform7/index.html"class="internal">inform7</a> compiler,
but a radical refactoring then moved the entire <ahref="index.html"class="internal">index</a> module into <ahref="../inter/index.html"class="internal">inter</a>
instead. Index products are now generated from trees of Inter code, not from
<pclass="commentary firstcommentary"><aid="SP3"class="paragraph-anchor"></a><b>§3. </b>The <ahref="index.html"class="internal">index</a> module has a very simple API: point it at a tree of Inter code,
say what sort of index you want, and go. See <ahref="1-ia.html"class="internal">Indexing API</a> for the details,
though the details are not much more than that.
</p>
<pclass="commentary firstcommentary"><aid="SP4"class="paragraph-anchor"></a><b>§4. Localisation. </b>A new and somewhat experimental addition in 2021 is the ability to localise the
Index, that is, to produce an Index in a language other than English. This does
not of course aim to translate source text: simply to translate subheadings, notes,
and other fixed-wording text in the Index.
</p>
<pclass="commentary">As a demonstration, try running a project with: