Jump to content

Template:Indexing: Difference between revisions

From Insurer Brain
Content deleted Content added
Deploy Template:Indexing (H6 heading + Has topic subobject)
Deploy Template:Indexing (H6 heading + Has topic subobject)
Line 6: Line 6:
|Has topic={{#if:{{{7|}}}|[[ID:{{{7}}}]]|}}
|Has topic={{#if:{{{7|}}}|[[ID:{{{7}}}]]|}}
|Has topic={{#if:{{{8|}}}|[[ID:{{{8}}}]]|}}
|Has topic={{#if:{{{8|}}}|[[ID:{{{8}}}]]|}}
|Has description={{{2|}}}
|Has summary={{{2|}}}
|Has indexed heading={{{1|}}}
|Has indexed heading={{{1|}}}
|Has unit kind={{{kind|}}}
|Has unit kind={{{kind|}}}
|Has order={{{order|}}}
|Has figure={{#if:{{{f1|}}}|{{{f1}}} = {{{v1|}}}|}}
|Has figure={{#if:{{{f1|}}}|{{{f1}}} = {{{v1|}}}|}}
|Has figure={{#if:{{{f2|}}}|{{{f2}}} = {{{v2|}}}|}}
|Has figure={{#if:{{{f2|}}}|{{{f2}}} = {{{v2|}}}|}}
Line 16: Line 17:
|Has figure={{#if:{{{f6|}}}|{{{f6}}} = {{{v6|}}}|}}
|Has figure={{#if:{{{f6|}}}|{{{f6}}} = {{{v6|}}}|}}
}}====== {{{1}}} ======
}}====== {{{1}}} ======
{{#if:{{{f1|}}}|<div class="unit-figures"><div class="unit-figures-head">Key figures</div>{{#if:{{{f1|}}}|<div class="unit-figures-row"><span class="unit-figures-label">{{{f1}}}</span><span class="unit-figures-value">{{{v1|}}}</span></div>}}{{#if:{{{f2|}}}|<div class="unit-figures-row"><span class="unit-figures-label">{{{f2}}}</span><span class="unit-figures-value">{{{v2|}}}</span></div>}}{{#if:{{{f3|}}}|<div class="unit-figures-row"><span class="unit-figures-label">{{{f3}}}</span><span class="unit-figures-value">{{{v3|}}}</span></div>}}{{#if:{{{f4|}}}|<div class="unit-figures-row"><span class="unit-figures-label">{{{f4}}}</span><span class="unit-figures-value">{{{v4|}}}</span></div>}}{{#if:{{{f5|}}}|<div class="unit-figures-row"><span class="unit-figures-label">{{{f5}}}</span><span class="unit-figures-value">{{{v5|}}}</span></div>}}{{#if:{{{f6|}}}|<div class="unit-figures-row"><span class="unit-figures-label">{{{f6}}}</span><span class="unit-figures-value">{{{v6|}}}</span></div>}}</div>}}</includeonly><noinclude>
{{#if:{{{f1|}}}|<table class="key-figures"><caption>Key figures</caption>{{#if:{{{f1|}}}|<tr><th>{{{f1}}}</th><td>{{{v1|}}}</td></tr>}}{{#if:{{{f2|}}}|<tr><th>{{{f2}}}</th><td>{{{v2|}}}</td></tr>}}{{#if:{{{f3|}}}|<tr><th>{{{f3}}}</th><td>{{{v3|}}}</td></tr>}}{{#if:{{{f4|}}}|<tr><th>{{{f4}}}</th><td>{{{v4|}}}</td></tr>}}{{#if:{{{f5|}}}|<tr><th>{{{f5}}}</th><td>{{{v5|}}}</td></tr>}}{{#if:{{{f6|}}}|<tr><th>{{{f6}}}</th><td>{{{v6|}}}</td></tr>}}</table>}}</includeonly><noinclude>
This is the section-indexing template. A doc_archive content unit is written as:
This is the section-indexing template. A doc_archive content unit is written as:


<code>{{Indexing|heading|description|topic_id_1|topic_id_2|…|kind=prose|f1=Employees|v1=1,014 (Dec 31, 2025)}}</code>
<code>{{Indexing|heading|summary|topic_id_1|topic_id_2|…|kind=prose|order=7|f1=Employees|v1=611 (Dec 31, 2025)}}</code>


It renders a level-6 heading (<code>====== heading ======</code>) AND records one
It renders a level-6 heading (<code>====== heading ======</code>) AND records one
SMW subobject linking <code>Has topic = [[ID:<id>]]</code> per topic id (page-links,
SMW subobject linking <code>Has topic = [[ID:<id>]]</code> per topic id (page-links,
so <code>[[Has topic::ID:<id>]]</code> and Special:WhatLinksHere resolve back to the
so <code>[[Has topic::ID:<id>]]</code> and Special:WhatLinksHere resolve back to the
section), plus <code>Has description</code>, <code>Has indexed heading</code> and
section), plus <code>Has summary</code>, <code>Has indexed heading</code>,
<code>Has unit kind</code> (named parameter <code>kind</code>: <code>prose</code> or
<code>Has unit kind</code> (named parameter <code>kind</code>: <code>prose</code> or
<code>table</code>, derived by the indexer from the unit body — retrieval filters
<code>table</code>, derived by the indexer from the unit body — retrieval filters
on it: slide building wants tables, answer drafting wants prose).
on it: slide building wants tables, answer drafting wants prose) and
<code>Has order</code> (named parameter <code>order</code>: the unit's 1-based
position in the document, so the Pagemap lists sections in source order).


Key figures: up to 6 label/value pairs (<code>f1</code>/<code>v1</code> …
Key figures: up to 6 label/value pairs (<code>f1</code>/<code>v1</code> …
<code>f6</code>/<code>v6</code>), PROSE units only — facts that live only in the
<code>f6</code>/<code>v6</code>), PROSE units only — the unit's key facts stated
narrative (headcounts, founding dates, business mix). Each pair renders a row in a
as numbers or named entities (headcounts, amounts, dates, percentages, business
right-floating <code>unit-figures</code> card (styled by Common.css §12) after the
mix). Each pair renders a row in a right-floating <code>key-figures</code> box
(an infobox-style card, styled by Common.css §12) after the heading, and stores a
heading, and stores a <code>Has figure</code> Text fact ("label = value") on the
<code>Has figure</code> Text fact ("label = value") on the same subobject. The
same subobject. The indexer verifies every digit-bearing value verbatim against
indexer verifies every digit-bearing value verbatim against the unit body before
the unit body before writing; a label without a value (or vice versa) is ignored.
writing; a label without a value (or vice versa) is ignored.


Up to 6 topic ids (positional args 3–8). Ids come from the <code>section_topics</code>
Up to 6 topic ids (positional args 3–8). Ids come from the <code>section_topics</code>

Revision as of 13:22, 4 July 2026

This is the section-indexing template. A doc_archive content unit is written as:

====== heading ======
Key figures
Employees611 (Dec 31, 2025)

It renders a level-6 heading (====== heading ======) AND records one SMW subobject linking Has topic = [[ID:<id>]] per topic id (page-links, so ID:<id> and Special:WhatLinksHere resolve back to the section), plus Has summary, Has indexed heading, Has unit kind (named parameter kind: prose or table, derived by the indexer from the unit body — retrieval filters on it: slide building wants tables, answer drafting wants prose) and Has order (named parameter order: the unit's 1-based position in the document, so the Pagemap lists sections in source order).

Key figures: up to 6 label/value pairs (f1/v1f6/v6), PROSE units only — the unit's key facts stated as numbers or named entities (headcounts, amounts, dates, percentages, business mix). Each pair renders a row in a right-floating key-figures box (an infobox-style card, styled by Common.css §12) after the heading, and stores a Has figure Text fact ("label = value") on the same subobject. The indexer verifies every digit-bearing value verbatim against the unit body before writing; a label without a value (or vice versa) is ignored.

Up to 6 topic ids (positional args 3–8). Ids come from the section_topics vocabulary in Data:term_map.json — each has a page in the ID: namespace. Written and kept current by tools/indexing/indexer.py; humans review via Module:PageMap, they do not edit this by hand.

The subobject's closing }} butts directly against ====== so the heading starts at column 0 (MediaWiki parses a heading only at line start).