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)
 
(One intermediate revision by the same user not shown)
Line 16: Line 16:
|Has figure={{#if:{{{f5|}}}|{{{f5}}} = {{{v5|}}}|}}
|Has figure={{#if:{{{f5|}}}|{{{f5}}} = {{{v5|}}}|}}
|Has figure={{#if:{{{f6|}}}|{{{f6}}} = {{{v6|}}}|}}
|Has figure={{#if:{{{f6|}}}|{{{f6}}} = {{{v6|}}}|}}
|Has figure={{#if:{{{f7|}}}|{{{f7}}} = {{{v7|}}}|}}
|Has figure={{#if:{{{f8|}}}|{{{f8}}} = {{{v8|}}}|}}
|Has figure={{#if:{{{f9|}}}|{{{f9}}} = {{{v9|}}}|}}
}}====== {{{1}}} ======
}}====== {{{1}}} ======
{{#if:{{{f1|}}}|<table class="key-figures"><tr><th class="key-figures-above" colspan="2">Key figures</th></tr>{{#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>
{{#if:{{{f1|}}}|<table class="key-figures"><tr><th class="key-figures-above" colspan="2">Key facts &amp; figures</th></tr>{{#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>}}{{#if:{{{f7|}}}|<tr><th>{{{f7}}}</th><td>{{{v7|}}}</td></tr>}}{{#if:{{{f8|}}}|<tr><th>{{{f8}}}</th><td>{{{v8|}}}</td></tr>}}{{#if:{{{f9|}}}|<tr><th>{{{f9}}}</th><td>{{{v9|}}}</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:


Line 32: Line 35:
position in the document, so the Pagemap lists sections in source order).
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 9 label/value pairs (<code>f1</code>/<code>v1</code> …
<code>f6</code>/<code>v6</code>), PROSE units only — the unit's key facts stated
<code>f9</code>/<code>v9</code>), PROSE units only — the unit's key facts stated
as numbers or named entities (headcounts, amounts, dates, percentages, business
as numbers or named entities (headcounts, amounts, dates, percentages, business
mix). Each pair renders a row in a right-floating <code>key-figures</code> box
mix). Each pair renders a row in a right-floating <code>key-figures</code> box

Latest revision as of 01:05, 5 July 2026

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

====== heading ======
Key facts & 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 9 label/value pairs (f1/v1f9/v9), 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).