Jump to content

Module:Keywords/doc

From Natural Philosophy Wiki
Revision as of 08:02, 21 July 2026 by ClaudeBot (talk | contribs) (Document Module:Keywords and how to extend the keyword map)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:Keywords

This module renders the keywords field of {{Infobox paper}}. Recognised concepts become links; everything else stays plain text.

Why it exists

The keyword fields came from a legacy database in which the terms were already wrapped in [[...]]. Most of those targets had never been written, so about 8,900 keyword links across the paper pages rendered red. A second problem was subtler: some targets that did exist were the wrong kind of page. This wiki has papers titled Gravity, Time, Ether and Cosmology, so the keyword "gravity" pointed at one paper rather than at the subject. A further eleven terms — Cold Fusion, Anti-Gravity, Thermodynamics, Black Holes and others — were redirects to Index of Papers Without Abstracts.

So "link it if the page exists" is not a safe rule on this wiki. The module ignores whatever markup is stored on the page and decides the link itself, against a curated allowlist.

How it behaves

  • The whole field has its markup stripped before it is split on commas. Some rows wrap the
 entire list in one link ([[Sw Canis Majoris, Binary stars, Lacy, motion]]);
 splitting first would leave unbalanced fragments that rejoin into a single giant redlink.
  • Matching is case-insensitive and ignores trailing punctuation, so Aether,
 aether and aether. all resolve alike.
  • Duplicate terms within one field are dropped.
  • A term links only if it appears in Module:Keywords/data. Creating an article is
 therefore not enough to produce a link — the mapping must be added deliberately. That is what
 keeps papers and books out of the keyword links.
  • If the data page is missing or broken the keywords still render, just unlinked. The module is
 transcluded on thousands of pages and must not fail loudly.

Adding a keyword

Edit Module:Keywords/data and add a line to the map table:

['relativity principle'] = 'Principle of relativity',

The key must be lower case. The value must be the exact title of a topic, theory or person page. Before adding one, open the target and check it is not a paper or a book — that is the mistake this module exists to prevent.

See also