<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.martinuswiki.dk/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wikiboteng%40Wikiboteng</id>
	<title>MartinusWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.martinuswiki.dk/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wikiboteng%40Wikiboteng"/>
	<link rel="alternate" type="text/html" href="https://en.martinuswiki.dk/wiki/Special:Contributions/Wikiboteng@Wikiboteng"/>
	<updated>2026-09-28T02:57:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://en.martinuswiki.dk/w/index.php?title=MartinusWiki:Source_languages_and_translations&amp;diff=326</id>
		<title>MartinusWiki:Source languages and translations</title>
		<link rel="alternate" type="text/html" href="https://en.martinuswiki.dk/w/index.php?title=MartinusWiki:Source_languages_and_translations&amp;diff=326"/>
		<updated>2026-08-26T04:56:00Z</updated>

		<summary type="html">&lt;p&gt;Wikiboteng@Wikiboteng: Add English Martinus reference system (Stage 4)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:MartinusWiki:Source languages and translations}}&lt;br /&gt;
&lt;br /&gt;
This page explains the &#039;&#039;(*)&#039;&#039; marker shown after some references to Martinus&#039;s works.&lt;br /&gt;
&lt;br /&gt;
== References to English sources ==&lt;br /&gt;
&lt;br /&gt;
An unmarked reference links directly to an English text in the official Martinus online library. The reference gives the work and section only; readers can follow the link to read the cited passage.&lt;br /&gt;
&lt;br /&gt;
== References marked as Danish sources ==&lt;br /&gt;
&lt;br /&gt;
The marker &#039;&#039;(*)&#039;&#039; means that the reference links to the Danish original. It is used when the cited work or passage is not available through the official English online library. The marker identifies the source language without repeating a long explanation in every reference list. For short books, the Danish book title is also shown directly in the reference.&lt;br /&gt;
&lt;br /&gt;
The Danish original may be cited when it is the available primary source for a claim. The citation does not imply that an English translation exists, nor that any wording in the article is an official English translation. Where an English text is available, MartinusWiki links to that text instead.&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
&lt;br /&gt;
The marker concerns the language of the linked source, not the language of the article. It can occur for later volumes of &#039;&#039;Livets Bog&#039;&#039;, later volumes of &#039;&#039;The Eternal World Picture&#039;&#039;, short books, lectures, and other Danish-only material.&lt;/div&gt;</summary>
		<author><name>Wikiboteng@Wikiboteng</name></author>
	</entry>
	<entry>
		<id>https://en.martinuswiki.dk/w/index.php?title=Help:References_to_Martinus_works&amp;diff=325</id>
		<title>Help:References to Martinus works</title>
		<link rel="alternate" type="text/html" href="https://en.martinuswiki.dk/w/index.php?title=Help:References_to_Martinus_works&amp;diff=325"/>
		<updated>2026-08-26T04:55:59Z</updated>

		<summary type="html">&lt;p&gt;Wikiboteng@Wikiboteng: Add English Martinus reference system (Stage 4)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains the English Martinus Wiki reference system. It uses the standard MediaWiki Cite extension: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; creates one numbered footnote, and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{reflist}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; prints the notes. A reference marked [[MartinusWiki:Source languages and translations|(*)]] links to a Danish original; unmarked references link to an English source.&lt;br /&gt;
&lt;br /&gt;
== Quick start ==&lt;br /&gt;
&lt;br /&gt;
Put a reference immediately after the claim it supports:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Livets Bog section 100{{ref|100}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end of the article add:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;== References ==&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{reflist}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template is only a wrapper. The validation and URL routing are in [[Module:Reference]]. Invalid references show a concise error and add [[:Category:Pages with Martinus reference errors]]; they must be fixed before saving.&lt;br /&gt;
&lt;br /&gt;
== Livets Bog (The Book of Life) ==&lt;br /&gt;
&lt;br /&gt;
An unqualified number uses the official section ranges to select a volume:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|100}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; — Livets Bog 1, section 100.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|2658|1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; — Livets Bog 7, section 2658, subsection 1, followed by the linked Danish-source marker.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|e}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; — the Livets Bog 7 epilogue, likewise marked as a Danish source.&lt;br /&gt;
&lt;br /&gt;
Use an explicit volume when that is clearer. The aliases &amp;lt;code&amp;gt;LB1&amp;lt;/code&amp;gt; through &amp;lt;code&amp;gt;LB7&amp;lt;/code&amp;gt; are accepted:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|LB1|100}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|work=LB2|section=607}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Livets Bog 1–5 link to the English online-library text. LB6–7 are retained for compatibility and are marked as Danish sources; see [[MartinusWiki:Source languages and translations]].&lt;br /&gt;
&lt;br /&gt;
== The Eternal World Picture (symbol books) ==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;TEWP&amp;lt;/code&amp;gt; (English) or the Danish-compatible alias &amp;lt;code&amp;gt;DEV&amp;lt;/code&amp;gt;, followed by the volume and section:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|TEWP 2|17.11}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|DEV 2|17.11}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The English online library currently provides volumes 1–4. Volumes 5–6 are accepted and are marked as Danish sources because the reference links to the Danish original.&lt;br /&gt;
&lt;br /&gt;
== Short books ==&lt;br /&gt;
&lt;br /&gt;
The English alias &amp;lt;code&amp;gt;short book&amp;lt;/code&amp;gt; and Danish-compatible aliases &amp;lt;code&amp;gt;småbog&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;smabog&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;pamphlet&amp;lt;/code&amp;gt; are accepted:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|short book 22|1.3}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The note links to the precise passage in the official Danish online library and is marked as a Danish source. Its Danish book title is shown directly in the reference. This is intentional: no English short-book URL is assumed.&lt;br /&gt;
&lt;br /&gt;
== Symbols, articles, lectures, and Kosmos ==&lt;br /&gt;
&lt;br /&gt;
Use a named source kind for these families:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|kind=symbol|1}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|kind=article|0010}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|kind=lecture|67}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|kind=kosmos|2021-2 &amp;quot;Article title&amp;quot;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Symbols link to the official English symbol page. Articles link to the English online library with the four-digit ID. Lectures and Kosmos references are marked as Danish sources; Kosmos notes preserve the supplied bibliographic text.&lt;br /&gt;
&lt;br /&gt;
The long-standing positional forms are also accepted: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|symbol|1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|article|0010}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|lecture|67}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|kosmos|2021-2 &amp;quot;Article title&amp;quot;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Invalid references ==&lt;br /&gt;
&lt;br /&gt;
Malformed or incomplete input is never silently discarded. For example:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|TEWP 2}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|article|10}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|100|unexpected|third|fourth}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These display a deterministic “Reference error: …” message in preview and add the maintenance category. Correct the citation rather than replacing it with an invented URL.&lt;br /&gt;
&lt;br /&gt;
== Other sources ==&lt;br /&gt;
&lt;br /&gt;
For a source that is not a Martinus work, use Cite directly rather than `{{ref}}`:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;ref&amp;gt;E. Miller, &#039;&#039;The Sun&#039;&#039;, Academic Press, 2005, pp. 23–25.&amp;lt;/ref&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This keeps generic references independent of the Martinus routing table. The system requires the Cite extension before it can be published; Stage 2 will validate every example with MediaWiki `action=parse`.&lt;/div&gt;</summary>
		<author><name>Wikiboteng@Wikiboteng</name></author>
	</entry>
	<entry>
		<id>https://en.martinuswiki.dk/w/index.php?title=Module:Reference&amp;diff=323</id>
		<title>Module:Reference</title>
		<link rel="alternate" type="text/html" href="https://en.martinuswiki.dk/w/index.php?title=Module:Reference&amp;diff=323"/>
		<updated>2026-08-26T04:54:23Z</updated>

		<summary type="html">&lt;p&gt;Wikiboteng@Wikiboteng: Add English Martinus reference system (Stage 4)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- English Martinus Wiki reference renderer.&lt;br /&gt;
--&lt;br /&gt;
-- Stage 1 source artifact.  This module deliberately contains the routing and&lt;br /&gt;
-- validation policy in one small, data-driven module so it can be copied to&lt;br /&gt;
-- Module:Reference after Scribunto is enabled.  It does not call ParserFunctions.&lt;br /&gt;
-- The public entry points are p.ref (the template wrapper) and p.render (a&lt;br /&gt;
-- direct module entry point); all state is local to an invocation.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local EN_TTT = &amp;quot;https://www.martinus.dk/en/online-library/ttt/index.php&amp;quot;&lt;br /&gt;
local DA_TTT = &amp;quot;https://www.martinus.dk/da/onlinebibliotek/dtt/index.php&amp;quot;&lt;br /&gt;
local EN_SYMBOLS = &amp;quot;https://www.martinus.dk/en/online-library/symbols/index.php&amp;quot;&lt;br /&gt;
local DA_LECTURES = &amp;quot;https://www.martinus.dk/da/onlinebibliotek/foredrag/index.php&amp;quot;&lt;br /&gt;
local ERROR_CATEGORY = &amp;quot;[[Category:Pages with Martinus reference errors]]&amp;quot;&lt;br /&gt;
local LANGUAGE_NOTICE = &amp;quot;[[MartinusWiki:Source languages and translations|(*)]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-- The section ranges are the ranges shown by the official online library.  LB6&lt;br /&gt;
-- and LB7 are retained for compatibility, but their English flag is false until&lt;br /&gt;
-- an English text is confirmed by the Institute.&lt;br /&gt;
local BOOKS = {&lt;br /&gt;
    LB1 = { id = 51, title = &amp;quot;Livets Bog 1&amp;quot;, first = 1, last = 288, english = true },&lt;br /&gt;
    LB2 = { id = 52, title = &amp;quot;Livets Bog 2&amp;quot;, first = 289, last = 638, english = true },&lt;br /&gt;
    LB3 = { id = 53, title = &amp;quot;Livets Bog 3&amp;quot;, first = 639, last = 1052, english = true },&lt;br /&gt;
    LB4 = { id = 54, title = &amp;quot;Livets Bog 4&amp;quot;, first = 1053, last = 1590, english = true },&lt;br /&gt;
    LB5 = { id = 55, title = &amp;quot;Livets Bog 5&amp;quot;, first = 1591, last = 1938, english = true },&lt;br /&gt;
    LB6 = { id = 56, title = &amp;quot;Livets Bog 6&amp;quot;, first = 1939, last = 2395, english = false },&lt;br /&gt;
    LB7 = { id = 57, title = &amp;quot;Livets Bog 7&amp;quot;, first = 2396, last = 2664, english = false },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local TEWP = {&lt;br /&gt;
    [1] = { id = 61, title = &amp;quot;The Eternal World Picture 1&amp;quot;, english = true },&lt;br /&gt;
    [2] = { id = 62, title = &amp;quot;The Eternal World Picture 2&amp;quot;, english = true },&lt;br /&gt;
    [3] = { id = 63, title = &amp;quot;The Eternal World Picture 3&amp;quot;, english = true },&lt;br /&gt;
    [4] = { id = 64, title = &amp;quot;The Eternal World Picture 4&amp;quot;, english = true },&lt;br /&gt;
    [5] = { id = 65, title = &amp;quot;The Eternal World Picture 5&amp;quot;, english = false },&lt;br /&gt;
    [6] = { id = 66, title = &amp;quot;The Eternal World Picture 6&amp;quot;, english = false },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Danish titles of the numbered short books, verified against the Danish&lt;br /&gt;
-- wiki&#039;s Småbøger catalogue. Showing the original title makes the source&lt;br /&gt;
-- language clear without adding an explanatory phrase to every reference.&lt;br /&gt;
local SHORT_BOOK_TITLES = {&lt;br /&gt;
    [1] = &amp;quot;Menneskehedens skæbne&amp;quot;, [2] = &amp;quot;Påske&amp;quot;, [3] = &amp;quot;Hvad er sandhed?&amp;quot;,&lt;br /&gt;
    [4] = &amp;quot;Omkring min missions fødsel&amp;quot;, [5] = &amp;quot;Den ideelle føde&amp;quot;,&lt;br /&gt;
    [6] = &amp;quot;Blade af Guds billedbog&amp;quot;, [7] = &amp;quot;Den længst levende afgud&amp;quot;,&lt;br /&gt;
    [8] = &amp;quot;Menneskeheden og verdensbilledet&amp;quot;, [9] = &amp;quot;Mellem to verdensepoker&amp;quot;,&lt;br /&gt;
    [10] = &amp;quot;Kosmisk bevidsthed&amp;quot;, [11] = &amp;quot;Bønnens mysterium&amp;quot;,&lt;br /&gt;
    [12] = &amp;quot;Vejen til indvielse&amp;quot;, [13] = &amp;quot;Juleevangeliet&amp;quot;,&lt;br /&gt;
    [14] = &amp;quot;Bevidsthedens skabelse&amp;quot;, [15] = &amp;quot;Ud af mørket&amp;quot;,&lt;br /&gt;
    [16] = &amp;quot;Reinkarnationsprincippet&amp;quot;, [17] = &amp;quot;Verdensreligion og verdenspolitik&amp;quot;,&lt;br /&gt;
    [18] = &amp;quot;Livets skæbnespil&amp;quot;, [19] = &amp;quot;Kosmiske glimt&amp;quot;, [20] = &amp;quot;Meditation&amp;quot;,&lt;br /&gt;
    [21] = &amp;quot;Hinsides dødsfrygten&amp;quot;, [22] = &amp;quot;Livets vej&amp;quot;,&lt;br /&gt;
    [23] = &amp;quot;De levende væsners udødelighed&amp;quot;, [24] = &amp;quot;Kulturens skabelse&amp;quot;,&lt;br /&gt;
    [25] = &amp;quot;Vejen til paradis&amp;quot;, [26] = &amp;quot;Djævlebevidsthed og Kristusbevidsthed&amp;quot;,&lt;br /&gt;
    [27] = &amp;quot;Verdensfredens skabelse&amp;quot;, [28] = &amp;quot;To slags kærlighed&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local ALLOWED = {&lt;br /&gt;
    [&amp;quot;1&amp;quot;] = true, [&amp;quot;2&amp;quot;] = true, [&amp;quot;3&amp;quot;] = true, [&amp;quot;4&amp;quot;] = true,&lt;br /&gt;
    [&amp;quot;5&amp;quot;] = true, [&amp;quot;6&amp;quot;] = true, [&amp;quot;7&amp;quot;] = true, [&amp;quot;8&amp;quot;] = true,&lt;br /&gt;
    [&amp;quot;9&amp;quot;] = true, [&amp;quot;10&amp;quot;] = true,&lt;br /&gt;
    work = true, source = true, section = true, subsection = true,&lt;br /&gt;
    kind = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function trim(value)&lt;br /&gt;
    if value == nil then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
    value = tostring(value):gsub(&amp;quot;^%s+&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;%s+$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    if value == &amp;quot;&amp;quot; then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
    return value&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function text(value)&lt;br /&gt;
    -- All values that reach this helper have already passed a strict grammar,&lt;br /&gt;
    -- except Kosmos text.  mw.text.encode prevents that free text becoming HTML.&lt;br /&gt;
    return mw.text.encode(tostring(value))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function error_message(code, detail)&lt;br /&gt;
    local suffix = detail and (&amp;quot; (&amp;quot; .. text(detail) .. &amp;quot;)&amp;quot;) or &amp;quot;&amp;quot;&lt;br /&gt;
    return &#039;&amp;lt;span class=&amp;quot;error reference-error&amp;quot;&amp;gt;Reference error: &#039; .. code .. suffix .. &amp;quot;&amp;lt;/span&amp;gt;&amp;quot; .. ERROR_CATEGORY&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function link(url, label)&lt;br /&gt;
    return &amp;quot;[&amp;quot; .. url .. &amp;quot; &amp;quot; .. text(label) .. &amp;quot;]&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function is_integer(value)&lt;br /&gt;
    return value ~= nil and value:match(&amp;quot;^[1-9]%d*$&amp;quot;) ~= nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function is_decimal_section(value)&lt;br /&gt;
    return value ~= nil and value:match(&amp;quot;^[1-9]%d*%.[1-9]%d*$&amp;quot;) ~= nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function language_marker(source_is_english)&lt;br /&gt;
    if source_is_english then&lt;br /&gt;
        return &amp;quot;&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return &amp;quot; &amp;quot; .. LANGUAGE_NOTICE&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function book_url(book, section, subsection)&lt;br /&gt;
    local base = book.english and EN_TTT or DA_TTT&lt;br /&gt;
    local url = base .. &amp;quot;?bog=&amp;quot; .. book.id&lt;br /&gt;
    -- The Danish online library treats mode=forside as an article request and&lt;br /&gt;
    -- invents art=1, producing an empty page for Livets Bog citations. Its&lt;br /&gt;
    -- own reference module omits mode entirely; retain mode=opslag only for&lt;br /&gt;
    -- the English library, where it selects the cited passage.&lt;br /&gt;
    if book.english and section then&lt;br /&gt;
        url = url .. &amp;quot;&amp;amp;mode=opslag&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if section then&lt;br /&gt;
        url = url .. &amp;quot;&amp;amp;stk=&amp;quot; .. section&lt;br /&gt;
    end&lt;br /&gt;
    if subsection then&lt;br /&gt;
        url = url .. &amp;quot;&amp;amp;pkt=&amp;quot; .. subsection&lt;br /&gt;
    end&lt;br /&gt;
    return url&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function book_reference(book, section, subsection)&lt;br /&gt;
    if not book then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
    if section and not is_integer(section) then&lt;br /&gt;
        return nil, &amp;quot;INVALID_SECTION&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if subsection and not is_integer(subsection) then&lt;br /&gt;
        return nil, &amp;quot;INVALID_SUBSECTION&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if subsection and not section then&lt;br /&gt;
        return nil, &amp;quot;MISSING_SECTION&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if section then&lt;br /&gt;
        local number = tonumber(section)&lt;br /&gt;
        if number &amp;lt; book.first or number &amp;gt; book.last then&lt;br /&gt;
            return nil, &amp;quot;SECTION_OUT_OF_RANGE&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    local label = book.title&lt;br /&gt;
    if section then&lt;br /&gt;
        label = label .. &amp;quot;, section &amp;quot; .. section&lt;br /&gt;
        if subsection then&lt;br /&gt;
            label = label .. &amp;quot;, subsection &amp;quot; .. subsection&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        label = label .. &amp;quot; (book)&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    local url = book_url(book, section, subsection)&lt;br /&gt;
    return link(url, label) .. language_marker(book.english)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function find_book_for_section(section)&lt;br /&gt;
    local number = tonumber(section)&lt;br /&gt;
    for _, key in ipairs({ &amp;quot;LB1&amp;quot;, &amp;quot;LB2&amp;quot;, &amp;quot;LB3&amp;quot;, &amp;quot;LB4&amp;quot;, &amp;quot;LB5&amp;quot;, &amp;quot;LB6&amp;quot;, &amp;quot;LB7&amp;quot; }) do&lt;br /&gt;
        local book = BOOKS[key]&lt;br /&gt;
        if number &amp;gt;= book.first and number &amp;lt;= book.last then&lt;br /&gt;
            return book&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function normalise_work(value)&lt;br /&gt;
    local upper = value:upper():gsub(&amp;quot;%s+&amp;quot;, &amp;quot; &amp;quot;)&lt;br /&gt;
    local lb = upper:match(&amp;quot;^(LB[1-7])$&amp;quot;)&lt;br /&gt;
    if lb then&lt;br /&gt;
        return &amp;quot;LB&amp;quot;, tonumber(lb:sub(3))&lt;br /&gt;
    end&lt;br /&gt;
    local tewp = upper:match(&amp;quot;^TEWP%s+([1-6])$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^DEV%s+([1-6])$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^THE ETERNAL WORLD PICTURE%s+([1-6])$&amp;quot;)&lt;br /&gt;
    if tewp then&lt;br /&gt;
        return &amp;quot;TEWP&amp;quot;, tonumber(tewp)&lt;br /&gt;
    end&lt;br /&gt;
    local short = upper:match(&amp;quot;^SHORT BOOK%s+([1-9]%d*)$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^SMÅBOG%s+([1-9]%d*)$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^SMABOG%s+([1-9]%d*)$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^PAMPHLET%s+([1-9]%d*)$&amp;quot;)&lt;br /&gt;
    if short then&lt;br /&gt;
        return &amp;quot;SHORT&amp;quot;, tonumber(short)&lt;br /&gt;
    end&lt;br /&gt;
    return upper&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function collect_args(argument_frame)&lt;br /&gt;
    local values = {}&lt;br /&gt;
    -- p.ref passes the Template:Ref frame explicitly. This is important:&lt;br /&gt;
    -- putting #invoke inside literal &amp;lt;ref&amp;gt; markup creates another parser frame&lt;br /&gt;
    -- and loses the template arguments. Reading this exact frame also keeps&lt;br /&gt;
    -- every argument visible to validation, including unknown names.&lt;br /&gt;
    if not argument_frame then&lt;br /&gt;
        return nil, &amp;quot;MISSING_PRIMARY_ARGUMENT&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    for key, raw in pairs(argument_frame.args or {}) do&lt;br /&gt;
        local name = tostring(key)&lt;br /&gt;
        local value = trim(raw)&lt;br /&gt;
        if value ~= nil then&lt;br /&gt;
            if not ALLOWED[name] then&lt;br /&gt;
                return nil, &amp;quot;UNSUPPORTED_ARGUMENT&amp;quot;, name&lt;br /&gt;
            end&lt;br /&gt;
            values[name] = value&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return values&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function positional(values)&lt;br /&gt;
    local result = {}&lt;br /&gt;
    for index = 1, 10 do&lt;br /&gt;
        if values[tostring(index)] ~= nil then&lt;br /&gt;
            result[index] = values[tostring(index)]&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    for index = 2, 10 do&lt;br /&gt;
        if result[index] ~= nil and result[index - 1] == nil then&lt;br /&gt;
            return nil, &amp;quot;MISSING_PRIMARY_ARGUMENT&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    for index = 4, 10 do&lt;br /&gt;
        if result[index] ~= nil then&lt;br /&gt;
            return nil, &amp;quot;TOO_MANY_POSITIONAL_ARGUMENTS&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function render_book(work, section, subsection)&lt;br /&gt;
    local family, volume = normalise_work(work)&lt;br /&gt;
    if family == &amp;quot;LB&amp;quot; then&lt;br /&gt;
        local book = BOOKS[&amp;quot;LB&amp;quot; .. volume]&lt;br /&gt;
        if not book then&lt;br /&gt;
            return nil, &amp;quot;UNKNOWN_VOLUME&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return book_reference(book, section, subsection)&lt;br /&gt;
    end&lt;br /&gt;
    if family == &amp;quot;TEWP&amp;quot; then&lt;br /&gt;
        local book = TEWP[volume]&lt;br /&gt;
        if not book then&lt;br /&gt;
            return nil, &amp;quot;UNKNOWN_VOLUME&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        if subsection then&lt;br /&gt;
            return nil, &amp;quot;TOO_MANY_SOURCE_ARGUMENTS&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        if not section or not is_decimal_section(section) then&lt;br /&gt;
            return nil, &amp;quot;INVALID_SYMBOL_SECTION&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        local base = book.english and EN_TTT or DA_TTT&lt;br /&gt;
        local url = base .. &amp;quot;?bog=&amp;quot; .. book.id&lt;br /&gt;
        if book.english then&lt;br /&gt;
            url = url .. &amp;quot;&amp;amp;mode=opslag&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        url = url .. &amp;quot;&amp;amp;pkt=&amp;quot; .. section:match(&amp;quot;%d+$&amp;quot;) .. &amp;quot;&amp;amp;stk=&amp;quot; .. section:match(&amp;quot;^%d+&amp;quot;)&lt;br /&gt;
        return link(url, book.title .. &amp;quot;, section &amp;quot; .. section) .. language_marker(book.english)&lt;br /&gt;
    end&lt;br /&gt;
    if family == &amp;quot;SHORT&amp;quot; then&lt;br /&gt;
        if subsection then&lt;br /&gt;
            return nil, &amp;quot;TOO_MANY_SOURCE_ARGUMENTS&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        if not section or not is_decimal_section(section) then&lt;br /&gt;
            return nil, &amp;quot;INVALID_SHORT_BOOK_SECTION&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        local _, passage = section:match(&amp;quot;^(%d+)%.(%d+)$&amp;quot;)&lt;br /&gt;
        -- Short books do not have an online-library article index.  Adding&lt;br /&gt;
        -- art=&amp;lt;chapter&amp;gt; makes the library look for a nonexistent article and&lt;br /&gt;
        -- return an empty page; the passage number is sufficient.&lt;br /&gt;
        local url = DA_TTT .. &amp;quot;?bog=&amp;quot; .. volume .. &amp;quot;&amp;amp;stk=&amp;quot; .. passage&lt;br /&gt;
        local title = SHORT_BOOK_TITLES[volume] or (&amp;quot;Short book &amp;quot; .. volume)&lt;br /&gt;
        return link(url, title .. &amp;quot;, section &amp;quot; .. section) .. language_marker(false)&lt;br /&gt;
    end&lt;br /&gt;
    return nil, &amp;quot;UNKNOWN_WORK&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function render_special(kind, value)&lt;br /&gt;
    local lowered = kind:lower()&lt;br /&gt;
    if lowered == &amp;quot;symbol&amp;quot; or lowered == &amp;quot;symbols&amp;quot; then&lt;br /&gt;
        if not is_integer(value) or tonumber(value) &amp;gt; 100 then&lt;br /&gt;
            return nil, &amp;quot;INVALID_SYMBOL_ID&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return link(EN_SYMBOLS .. &amp;quot;?symbol=&amp;quot; .. value, &amp;quot;Symbol &amp;quot; .. value)&lt;br /&gt;
    end&lt;br /&gt;
    if lowered == &amp;quot;article&amp;quot; or lowered == &amp;quot;articles&amp;quot; then&lt;br /&gt;
        if not value or value:match(&amp;quot;^%d%d%d%d$&amp;quot;) == nil then&lt;br /&gt;
            return nil, &amp;quot;INVALID_ARTICLE_ID&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return link(EN_TTT .. &amp;quot;?art=&amp;quot; .. value .. &amp;quot;&amp;amp;mode=artikelopslag&amp;quot;, &amp;quot;Article &amp;quot; .. value)&lt;br /&gt;
    end&lt;br /&gt;
    if lowered == &amp;quot;lecture&amp;quot; or lowered == &amp;quot;lectures&amp;quot; or lowered == &amp;quot;foredrag&amp;quot; then&lt;br /&gt;
        if not is_integer(value) then&lt;br /&gt;
            return nil, &amp;quot;INVALID_LECTURE_ID&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return link(DA_LECTURES .. &amp;quot;?nr=&amp;quot; .. value, &amp;quot;Lecture &amp;quot; .. value) .. language_marker(false)&lt;br /&gt;
    end&lt;br /&gt;
    if lowered == &amp;quot;kosmos&amp;quot; then&lt;br /&gt;
        if not value then&lt;br /&gt;
            return nil, &amp;quot;MISSING_KOSMOS_DESCRIPTION&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return text(&amp;quot;Kosmos: &amp;quot; .. value) .. language_marker(false)&lt;br /&gt;
    end&lt;br /&gt;
    return nil, &amp;quot;UNKNOWN_SOURCE_KIND&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function render_reference(argument_frame)&lt;br /&gt;
    local values, collect_error, collect_detail = collect_args(argument_frame)&lt;br /&gt;
    if not values then&lt;br /&gt;
        return error_message(collect_error, collect_detail)&lt;br /&gt;
    end&lt;br /&gt;
    local pos, positional_error = positional(values)&lt;br /&gt;
    if not pos then&lt;br /&gt;
        return error_message(positional_error)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local work = values.work or values.source&lt;br /&gt;
    local section = values.section&lt;br /&gt;
    local subsection = values.subsection&lt;br /&gt;
    local kind = values.kind&lt;br /&gt;
&lt;br /&gt;
    if values.work and values.source then&lt;br /&gt;
        return error_message(&amp;quot;DUPLICATE_WORK_ARGUMENTS&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    if values.section and pos[2] then&lt;br /&gt;
        return error_message(&amp;quot;DUPLICATE_SECTION_ARGUMENT&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    if values.subsection and pos[3] then&lt;br /&gt;
        return error_message(&amp;quot;DUPLICATE_SUBSECTION_ARGUMENT&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if kind then&lt;br /&gt;
        if pos[2] or pos[3] or work or section or subsection then&lt;br /&gt;
            return error_message(&amp;quot;MIXED_REFERENCE_FORMS&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        local special_result, special_error = render_special(kind, pos[1] or values[&amp;quot;1&amp;quot;])&lt;br /&gt;
        if not special_result then&lt;br /&gt;
            return error_message(special_error)&lt;br /&gt;
        end&lt;br /&gt;
        return special_result&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if work and pos[1] then&lt;br /&gt;
        return error_message(&amp;quot;MIXED_REFERENCE_FORMS&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if work then&lt;br /&gt;
        section = section or pos[2]&lt;br /&gt;
        subsection = subsection or pos[3]&lt;br /&gt;
    else&lt;br /&gt;
        work = pos[1]&lt;br /&gt;
        section = section or pos[2]&lt;br /&gt;
        subsection = subsection or pos[3]&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if not work then&lt;br /&gt;
        return error_message(&amp;quot;MISSING_PRIMARY_ARGUMENT&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if is_integer(work) then&lt;br /&gt;
        if section and subsection then&lt;br /&gt;
            return error_message(&amp;quot;DUPLICATE_SUBSECTION_ARGUMENT&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        if section and not is_integer(section) then&lt;br /&gt;
            return error_message(&amp;quot;INVALID_SUBSECTION&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        local book = find_book_for_section(work)&lt;br /&gt;
        if not book then&lt;br /&gt;
            return error_message(&amp;quot;SECTION_OUT_OF_RANGE&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        -- For numeric shorthand the second value is the subsection.  Accept&lt;br /&gt;
        -- either positional 2 or the named subsection form, but never discard&lt;br /&gt;
        -- a third positional value.&lt;br /&gt;
        local numeric_subsection = subsection or section&lt;br /&gt;
        local result, render_error = book_reference(book, work, numeric_subsection)&lt;br /&gt;
        if not result then&lt;br /&gt;
            return error_message(render_error)&lt;br /&gt;
        end&lt;br /&gt;
        return result&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if work:lower() == &amp;quot;e&amp;quot; or work:lower() == &amp;quot;epilogue&amp;quot; then&lt;br /&gt;
        if section or subsection then&lt;br /&gt;
            return error_message(&amp;quot;UNEXPECTED_EPILOGUE_ARGUMENT&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        local book = BOOKS.LB7&lt;br /&gt;
        return link(book_url(book, &amp;quot;2665&amp;quot;), &amp;quot;Livets Bog 7, epilogue (section 2665)&amp;quot;) .. language_marker(false)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local special_kind = work:lower()&lt;br /&gt;
    if special_kind == &amp;quot;symbol&amp;quot; or special_kind == &amp;quot;symbols&amp;quot;&lt;br /&gt;
        or special_kind == &amp;quot;article&amp;quot; or special_kind == &amp;quot;articles&amp;quot;&lt;br /&gt;
        or special_kind == &amp;quot;lecture&amp;quot; or special_kind == &amp;quot;lectures&amp;quot;&lt;br /&gt;
        or special_kind == &amp;quot;foredrag&amp;quot; or special_kind == &amp;quot;kosmos&amp;quot; then&lt;br /&gt;
        if subsection then&lt;br /&gt;
            return error_message(&amp;quot;TOO_MANY_SOURCE_ARGUMENTS&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        local special_result, special_error = render_special(work, section)&lt;br /&gt;
        if not special_result then&lt;br /&gt;
            return error_message(special_error)&lt;br /&gt;
        end&lt;br /&gt;
        return special_result&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local result, render_error = render_book(work, section, subsection)&lt;br /&gt;
    if not result then&lt;br /&gt;
        return error_message(render_error)&lt;br /&gt;
    end&lt;br /&gt;
    return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.render(frame)&lt;br /&gt;
    return render_reference(frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.ref(frame)&lt;br /&gt;
    local parent = frame and frame:getParent()&lt;br /&gt;
    local content = render_reference(parent)&lt;br /&gt;
    local has_error_category = content:sub(-#ERROR_CATEGORY) == ERROR_CATEGORY&lt;br /&gt;
    if has_error_category then&lt;br /&gt;
        -- Category links inside a Cite extension tag are not reliably attached&lt;br /&gt;
        -- to the page. Keep the error text in the note, but emit the marker&lt;br /&gt;
        -- outside the tag so the maintenance category is authoritative.&lt;br /&gt;
        content = content:sub(1, -#ERROR_CATEGORY - 1)&lt;br /&gt;
    end&lt;br /&gt;
    local reference = frame:extensionTag(&amp;quot;ref&amp;quot;, content)&lt;br /&gt;
    if has_error_category then&lt;br /&gt;
        reference = reference .. ERROR_CATEGORY&lt;br /&gt;
    end&lt;br /&gt;
    return reference&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Wikiboteng@Wikiboteng</name></author>
	</entry>
	<entry>
		<id>https://en.martinuswiki.dk/w/index.php?title=User:Lasse&amp;diff=74</id>
		<title>User:Lasse</title>
		<link rel="alternate" type="text/html" href="https://en.martinuswiki.dk/w/index.php?title=User:Lasse&amp;diff=74"/>
		<updated>2026-08-11T09:26:14Z</updated>

		<summary type="html">&lt;p&gt;Wikiboteng@Wikiboteng: Add test reference on User:Lasse&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi, I am Lasse :-)&lt;br /&gt;
&lt;br /&gt;
Check out my Youtube channel https://www.youtube.com/@theeternalworldpicture&lt;br /&gt;
&lt;br /&gt;
Test&lt;br /&gt;
&lt;br /&gt;
== Reference system test ==&lt;br /&gt;
&lt;br /&gt;
This is a test reference to Livets Bog, section 100.{{ref|100}}&lt;br /&gt;
&lt;br /&gt;
{{reflist}}&lt;/div&gt;</summary>
		<author><name>Wikiboteng@Wikiboteng</name></author>
	</entry>
	<entry>
		<id>https://en.martinuswiki.dk/w/index.php?title=Help:References_to_Martinus_works&amp;diff=73</id>
		<title>Help:References to Martinus works</title>
		<link rel="alternate" type="text/html" href="https://en.martinuswiki.dk/w/index.php?title=Help:References_to_Martinus_works&amp;diff=73"/>
		<updated>2026-08-11T06:12:52Z</updated>

		<summary type="html">&lt;p&gt;Wikiboteng@Wikiboteng: Add English Martinus reference system (Stage 4)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains the English Martinus Wiki reference system. It uses the standard MediaWiki Cite extension: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; creates one numbered footnote, and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{reflist}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; prints the notes.&lt;br /&gt;
&lt;br /&gt;
== Quick start ==&lt;br /&gt;
&lt;br /&gt;
Put a reference immediately after the claim it supports:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Livets Bog section 100{{ref|100}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end of the article add:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;== References ==&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{reflist}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template is only a wrapper. The validation and URL routing are in [[Module:Reference]]. Invalid references show a concise error and add [[:Category:Pages with Martinus reference errors]]; they must be fixed before saving.&lt;br /&gt;
&lt;br /&gt;
== Livets Bog (The Book of Life) ==&lt;br /&gt;
&lt;br /&gt;
An unqualified number uses the official section ranges to select a volume:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|100}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; — Livets Bog 1, section 100.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|2658|1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; — Livets Bog 7, section 2658, subsection 1. Livets Bog 7 is currently linked to the Danish original because an English text is not confirmed.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|e}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; — the Livets Bog 7 epilogue, with the same explicit Danish fallback.&lt;br /&gt;
&lt;br /&gt;
Use an explicit volume when that is clearer. The aliases &amp;lt;code&amp;gt;LB1&amp;lt;/code&amp;gt; through &amp;lt;code&amp;gt;LB7&amp;lt;/code&amp;gt; are accepted:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|LB1|100}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|work=LB2|section=607}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Livets Bog 1–5 link to the English online-library text. LB6–7 are retained for compatibility and say “Danish original; no English translation confirmed” in the note.&lt;br /&gt;
&lt;br /&gt;
== The Eternal World Picture (symbol books) ==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;TEWP&amp;lt;/code&amp;gt; (English) or the Danish-compatible alias &amp;lt;code&amp;gt;DEV&amp;lt;/code&amp;gt;, followed by the volume and section:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|TEWP 2|17.11}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|DEV 2|17.11}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The English online library currently provides volumes 1–4. Volumes 5–6 are accepted but use an explicit Danish fallback.&lt;br /&gt;
&lt;br /&gt;
== Short books ==&lt;br /&gt;
&lt;br /&gt;
The English alias &amp;lt;code&amp;gt;short book&amp;lt;/code&amp;gt; and Danish-compatible aliases &amp;lt;code&amp;gt;småbog&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;smabog&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;pamphlet&amp;lt;/code&amp;gt; are accepted:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|short book 22|1.3}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The note links to the precise passage in the official Danish online library and says that an English translation is not confirmed. This is intentional: no English short-book URL is assumed.&lt;br /&gt;
&lt;br /&gt;
== Symbols, articles, lectures, and Kosmos ==&lt;br /&gt;
&lt;br /&gt;
Use a named source kind for these families:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|kind=symbol|1}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|kind=article|0010}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|kind=lecture|67}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|kind=kosmos|2021-2 &amp;quot;Article title&amp;quot;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Symbols link to the official English symbol page. Articles link to the English online library with the four-digit ID; the note says “English online text if available” because availability varies. Lectures have an explicit Danish fallback. Kosmos notes preserve the supplied bibliographic text and explicitly state that no direct online-library link is confirmed.&lt;br /&gt;
&lt;br /&gt;
The long-standing positional forms are also accepted: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|symbol|1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|article|0010}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|lecture|67}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ref|kosmos|2021-2 &amp;quot;Article title&amp;quot;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Invalid references ==&lt;br /&gt;
&lt;br /&gt;
Malformed or incomplete input is never silently discarded. For example:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|TEWP 2}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|article|10}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{ref|100|unexpected|third|fourth}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These display a deterministic “Reference error: …” message in preview and add the maintenance category. Correct the citation rather than replacing it with an invented URL.&lt;br /&gt;
&lt;br /&gt;
== Other sources ==&lt;br /&gt;
&lt;br /&gt;
For a source that is not a Martinus work, use Cite directly rather than `{{ref}}`:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;ref&amp;gt;E. Miller, &#039;&#039;The Sun&#039;&#039;, Academic Press, 2005, pp. 23–25.&amp;lt;/ref&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This keeps generic references independent of the Martinus routing table. The system requires the Cite extension before it can be published; Stage 2 will validate every example with MediaWiki `action=parse`.&lt;/div&gt;</summary>
		<author><name>Wikiboteng@Wikiboteng</name></author>
	</entry>
	<entry>
		<id>https://en.martinuswiki.dk/w/index.php?title=Template:Reflist&amp;diff=72</id>
		<title>Template:Reflist</title>
		<link rel="alternate" type="text/html" href="https://en.martinuswiki.dk/w/index.php?title=Template:Reflist&amp;diff=72"/>
		<updated>2026-08-11T06:12:49Z</updated>

		<summary type="html">&lt;p&gt;Wikiboteng@Wikiboteng: Add English Martinus reference system (Stage 4)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wikiboteng@Wikiboteng</name></author>
	</entry>
	<entry>
		<id>https://en.martinuswiki.dk/w/index.php?title=Template:Ref&amp;diff=71</id>
		<title>Template:Ref</title>
		<link rel="alternate" type="text/html" href="https://en.martinuswiki.dk/w/index.php?title=Template:Ref&amp;diff=71"/>
		<updated>2026-08-11T06:12:47Z</updated>

		<summary type="html">&lt;p&gt;Wikiboteng@Wikiboteng: Add English Martinus reference system (Stage 4)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- p.ref reads this template frame directly and creates the Cite extension&lt;br /&gt;
     tag through frame:extensionTag, so nested parser markup cannot lose args. --&amp;gt;&lt;br /&gt;
{{#invoke:Reference|ref}}&lt;/div&gt;</summary>
		<author><name>Wikiboteng@Wikiboteng</name></author>
	</entry>
	<entry>
		<id>https://en.martinuswiki.dk/w/index.php?title=Module:Reference&amp;diff=70</id>
		<title>Module:Reference</title>
		<link rel="alternate" type="text/html" href="https://en.martinuswiki.dk/w/index.php?title=Module:Reference&amp;diff=70"/>
		<updated>2026-08-11T06:12:44Z</updated>

		<summary type="html">&lt;p&gt;Wikiboteng@Wikiboteng: Add English Martinus reference system (Stage 4)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- English Martinus Wiki reference renderer.&lt;br /&gt;
--&lt;br /&gt;
-- Stage 1 source artifact.  This module deliberately contains the routing and&lt;br /&gt;
-- validation policy in one small, data-driven module so it can be copied to&lt;br /&gt;
-- Module:Reference after Scribunto is enabled.  It does not call ParserFunctions.&lt;br /&gt;
-- The public entry points are p.ref (the template wrapper) and p.render (a&lt;br /&gt;
-- direct module entry point); all state is local to an invocation.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local EN_TTT = &amp;quot;https://www.martinus.dk/en/online-library/ttt/index.php&amp;quot;&lt;br /&gt;
local DA_TTT = &amp;quot;https://www.martinus.dk/da/onlinebibliotek/dtt/index.php&amp;quot;&lt;br /&gt;
local EN_SYMBOLS = &amp;quot;https://www.martinus.dk/en/online-library/symbols/index.php&amp;quot;&lt;br /&gt;
local DA_LECTURES = &amp;quot;https://www.martinus.dk/da/onlinebibliotek/foredrag/index.php&amp;quot;&lt;br /&gt;
local ERROR_CATEGORY = &amp;quot;[[Category:Pages with Martinus reference errors]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-- The section ranges are the ranges shown by the official online library.  LB6&lt;br /&gt;
-- and LB7 are retained for compatibility, but their English flag is false until&lt;br /&gt;
-- an English text is confirmed by the Institute.&lt;br /&gt;
local BOOKS = {&lt;br /&gt;
    LB1 = { id = 51, title = &amp;quot;Livets Bog 1&amp;quot;, first = 1, last = 288, english = true },&lt;br /&gt;
    LB2 = { id = 52, title = &amp;quot;Livets Bog 2&amp;quot;, first = 289, last = 638, english = true },&lt;br /&gt;
    LB3 = { id = 53, title = &amp;quot;Livets Bog 3&amp;quot;, first = 639, last = 1052, english = true },&lt;br /&gt;
    LB4 = { id = 54, title = &amp;quot;Livets Bog 4&amp;quot;, first = 1053, last = 1590, english = true },&lt;br /&gt;
    LB5 = { id = 55, title = &amp;quot;Livets Bog 5&amp;quot;, first = 1591, last = 1938, english = true },&lt;br /&gt;
    LB6 = { id = 56, title = &amp;quot;Livets Bog 6&amp;quot;, first = 1939, last = 2395, english = false },&lt;br /&gt;
    LB7 = { id = 57, title = &amp;quot;Livets Bog 7&amp;quot;, first = 2396, last = 2664, english = false },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local TEWP = {&lt;br /&gt;
    [1] = { id = 61, title = &amp;quot;The Eternal World Picture 1&amp;quot;, english = true },&lt;br /&gt;
    [2] = { id = 62, title = &amp;quot;The Eternal World Picture 2&amp;quot;, english = true },&lt;br /&gt;
    [3] = { id = 63, title = &amp;quot;The Eternal World Picture 3&amp;quot;, english = true },&lt;br /&gt;
    [4] = { id = 64, title = &amp;quot;The Eternal World Picture 4&amp;quot;, english = true },&lt;br /&gt;
    [5] = { id = 65, title = &amp;quot;The Eternal World Picture 5&amp;quot;, english = false },&lt;br /&gt;
    [6] = { id = 66, title = &amp;quot;The Eternal World Picture 6&amp;quot;, english = false },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local ALLOWED = {&lt;br /&gt;
    [&amp;quot;1&amp;quot;] = true, [&amp;quot;2&amp;quot;] = true, [&amp;quot;3&amp;quot;] = true, [&amp;quot;4&amp;quot;] = true,&lt;br /&gt;
    [&amp;quot;5&amp;quot;] = true, [&amp;quot;6&amp;quot;] = true, [&amp;quot;7&amp;quot;] = true, [&amp;quot;8&amp;quot;] = true,&lt;br /&gt;
    [&amp;quot;9&amp;quot;] = true, [&amp;quot;10&amp;quot;] = true,&lt;br /&gt;
    work = true, source = true, section = true, subsection = true,&lt;br /&gt;
    kind = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function trim(value)&lt;br /&gt;
    if value == nil then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
    value = tostring(value):gsub(&amp;quot;^%s+&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;%s+$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    if value == &amp;quot;&amp;quot; then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
    return value&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function text(value)&lt;br /&gt;
    -- All values that reach this helper have already passed a strict grammar,&lt;br /&gt;
    -- except Kosmos text.  mw.text.encode prevents that free text becoming HTML.&lt;br /&gt;
    return mw.text.encode(tostring(value))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function error_message(code, detail)&lt;br /&gt;
    local suffix = detail and (&amp;quot; (&amp;quot; .. text(detail) .. &amp;quot;)&amp;quot;) or &amp;quot;&amp;quot;&lt;br /&gt;
    return &#039;&amp;lt;span class=&amp;quot;error reference-error&amp;quot;&amp;gt;Reference error: &#039; .. code .. suffix .. &amp;quot;&amp;lt;/span&amp;gt;&amp;quot; .. ERROR_CATEGORY&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function link(url, label)&lt;br /&gt;
    return &amp;quot;[&amp;quot; .. url .. &amp;quot; &amp;quot; .. text(label) .. &amp;quot;]&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function is_integer(value)&lt;br /&gt;
    return value ~= nil and value:match(&amp;quot;^[1-9]%d*$&amp;quot;) ~= nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function is_decimal_section(value)&lt;br /&gt;
    return value ~= nil and value:match(&amp;quot;^[1-9]%d*%.[1-9]%d*$&amp;quot;) ~= nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function source_suffix(book)&lt;br /&gt;
    if book.english then&lt;br /&gt;
        return &amp;quot;English online text&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return &amp;quot;Danish original; no English translation confirmed&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function book_url(book, section, subsection)&lt;br /&gt;
    local base = book.english and EN_TTT or DA_TTT&lt;br /&gt;
    local mode = section and (book.english and &amp;quot;opslag&amp;quot; or &amp;quot;forside&amp;quot;) or &amp;quot;forside&amp;quot;&lt;br /&gt;
    local url = base .. &amp;quot;?bog=&amp;quot; .. book.id .. &amp;quot;&amp;amp;mode=&amp;quot; .. mode&lt;br /&gt;
    if section then&lt;br /&gt;
        url = url .. &amp;quot;&amp;amp;stk=&amp;quot; .. section&lt;br /&gt;
    end&lt;br /&gt;
    if subsection then&lt;br /&gt;
        url = url .. &amp;quot;&amp;amp;pkt=&amp;quot; .. subsection&lt;br /&gt;
    end&lt;br /&gt;
    return url&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function book_reference(book, section, subsection)&lt;br /&gt;
    if not book then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
    if section and not is_integer(section) then&lt;br /&gt;
        return nil, &amp;quot;INVALID_SECTION&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if subsection and not is_integer(subsection) then&lt;br /&gt;
        return nil, &amp;quot;INVALID_SUBSECTION&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if subsection and not section then&lt;br /&gt;
        return nil, &amp;quot;MISSING_SECTION&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if section then&lt;br /&gt;
        local number = tonumber(section)&lt;br /&gt;
        if number &amp;lt; book.first or number &amp;gt; book.last then&lt;br /&gt;
            return nil, &amp;quot;SECTION_OUT_OF_RANGE&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    local label = book.title&lt;br /&gt;
    if section then&lt;br /&gt;
        label = label .. &amp;quot;, section &amp;quot; .. section&lt;br /&gt;
        if subsection then&lt;br /&gt;
            label = label .. &amp;quot;, subsection &amp;quot; .. subsection&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        label = label .. &amp;quot; (book)&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    local url = book_url(book, section, subsection)&lt;br /&gt;
    return link(url, label .. &amp;quot; — &amp;quot; .. source_suffix(book))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function find_book_for_section(section)&lt;br /&gt;
    local number = tonumber(section)&lt;br /&gt;
    for _, key in ipairs({ &amp;quot;LB1&amp;quot;, &amp;quot;LB2&amp;quot;, &amp;quot;LB3&amp;quot;, &amp;quot;LB4&amp;quot;, &amp;quot;LB5&amp;quot;, &amp;quot;LB6&amp;quot;, &amp;quot;LB7&amp;quot; }) do&lt;br /&gt;
        local book = BOOKS[key]&lt;br /&gt;
        if number &amp;gt;= book.first and number &amp;lt;= book.last then&lt;br /&gt;
            return book&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function normalise_work(value)&lt;br /&gt;
    local upper = value:upper():gsub(&amp;quot;%s+&amp;quot;, &amp;quot; &amp;quot;)&lt;br /&gt;
    local lb = upper:match(&amp;quot;^(LB[1-7])$&amp;quot;)&lt;br /&gt;
    if lb then&lt;br /&gt;
        return &amp;quot;LB&amp;quot;, tonumber(lb:sub(3))&lt;br /&gt;
    end&lt;br /&gt;
    local tewp = upper:match(&amp;quot;^TEWP%s+([1-6])$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^DEV%s+([1-6])$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^THE ETERNAL WORLD PICTURE%s+([1-6])$&amp;quot;)&lt;br /&gt;
    if tewp then&lt;br /&gt;
        return &amp;quot;TEWP&amp;quot;, tonumber(tewp)&lt;br /&gt;
    end&lt;br /&gt;
    local short = upper:match(&amp;quot;^SHORT BOOK%s+([1-9]%d*)$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^SMÅBOG%s+([1-9]%d*)$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^SMABOG%s+([1-9]%d*)$&amp;quot;)&lt;br /&gt;
        or upper:match(&amp;quot;^PAMPHLET%s+([1-9]%d*)$&amp;quot;)&lt;br /&gt;
    if short then&lt;br /&gt;
        return &amp;quot;SHORT&amp;quot;, tonumber(short)&lt;br /&gt;
    end&lt;br /&gt;
    return upper&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function collect_args(argument_frame)&lt;br /&gt;
    local values = {}&lt;br /&gt;
    -- p.ref passes the Template:Ref frame explicitly. This is important:&lt;br /&gt;
    -- putting #invoke inside literal &amp;lt;ref&amp;gt; markup creates another parser frame&lt;br /&gt;
    -- and loses the template arguments. Reading this exact frame also keeps&lt;br /&gt;
    -- every argument visible to validation, including unknown names.&lt;br /&gt;
    if not argument_frame then&lt;br /&gt;
        return nil, &amp;quot;MISSING_PRIMARY_ARGUMENT&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    for key, raw in pairs(argument_frame.args or {}) do&lt;br /&gt;
        local name = tostring(key)&lt;br /&gt;
        local value = trim(raw)&lt;br /&gt;
        if value ~= nil then&lt;br /&gt;
            if not ALLOWED[name] then&lt;br /&gt;
                return nil, &amp;quot;UNSUPPORTED_ARGUMENT&amp;quot;, name&lt;br /&gt;
            end&lt;br /&gt;
            values[name] = value&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return values&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function positional(values)&lt;br /&gt;
    local result = {}&lt;br /&gt;
    for index = 1, 10 do&lt;br /&gt;
        if values[tostring(index)] ~= nil then&lt;br /&gt;
            result[index] = values[tostring(index)]&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    for index = 2, 10 do&lt;br /&gt;
        if result[index] ~= nil and result[index - 1] == nil then&lt;br /&gt;
            return nil, &amp;quot;MISSING_PRIMARY_ARGUMENT&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    for index = 4, 10 do&lt;br /&gt;
        if result[index] ~= nil then&lt;br /&gt;
            return nil, &amp;quot;TOO_MANY_POSITIONAL_ARGUMENTS&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function render_book(work, section, subsection)&lt;br /&gt;
    local family, volume = normalise_work(work)&lt;br /&gt;
    if family == &amp;quot;LB&amp;quot; then&lt;br /&gt;
        local book = BOOKS[&amp;quot;LB&amp;quot; .. volume]&lt;br /&gt;
        if not book then&lt;br /&gt;
            return nil, &amp;quot;UNKNOWN_VOLUME&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return book_reference(book, section, subsection)&lt;br /&gt;
    end&lt;br /&gt;
    if family == &amp;quot;TEWP&amp;quot; then&lt;br /&gt;
        local book = TEWP[volume]&lt;br /&gt;
        if not book then&lt;br /&gt;
            return nil, &amp;quot;UNKNOWN_VOLUME&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        if subsection then&lt;br /&gt;
            return nil, &amp;quot;TOO_MANY_SOURCE_ARGUMENTS&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        if not section or not is_decimal_section(section) then&lt;br /&gt;
            return nil, &amp;quot;INVALID_SYMBOL_SECTION&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        local base = book.english and EN_TTT or DA_TTT&lt;br /&gt;
        local url = base .. &amp;quot;?bog=&amp;quot; .. book.id .. &amp;quot;&amp;amp;mode=opslag&amp;amp;pkt=&amp;quot; .. section:match(&amp;quot;%d+$&amp;quot;) .. &amp;quot;&amp;amp;stk=&amp;quot; .. section:match(&amp;quot;^%d+&amp;quot;)&lt;br /&gt;
        return link(url, book.title .. &amp;quot;, section &amp;quot; .. section .. &amp;quot; — &amp;quot; .. source_suffix(book))&lt;br /&gt;
    end&lt;br /&gt;
    if family == &amp;quot;SHORT&amp;quot; then&lt;br /&gt;
        if subsection then&lt;br /&gt;
            return nil, &amp;quot;TOO_MANY_SOURCE_ARGUMENTS&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        if not section or not is_decimal_section(section) then&lt;br /&gt;
            return nil, &amp;quot;INVALID_SHORT_BOOK_SECTION&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        local chapter, passage = section:match(&amp;quot;^(%d+)%.(%d+)$&amp;quot;)&lt;br /&gt;
        local url = DA_TTT .. &amp;quot;?bog=&amp;quot; .. volume .. &amp;quot;&amp;amp;art=&amp;quot; .. chapter .. &amp;quot;&amp;amp;stk=&amp;quot; .. passage&lt;br /&gt;
        return link(url, &amp;quot;Short book &amp;quot; .. volume .. &amp;quot;, section &amp;quot; .. section .. &amp;quot; — Danish original; English translation not confirmed&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    return nil, &amp;quot;UNKNOWN_WORK&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function render_special(kind, value)&lt;br /&gt;
    local lowered = kind:lower()&lt;br /&gt;
    if lowered == &amp;quot;symbol&amp;quot; or lowered == &amp;quot;symbols&amp;quot; then&lt;br /&gt;
        if not is_integer(value) or tonumber(value) &amp;gt; 100 then&lt;br /&gt;
            return nil, &amp;quot;INVALID_SYMBOL_ID&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return link(EN_SYMBOLS .. &amp;quot;?symbol=&amp;quot; .. value, &amp;quot;Symbol &amp;quot; .. value .. &amp;quot; — English symbol page&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    if lowered == &amp;quot;article&amp;quot; or lowered == &amp;quot;articles&amp;quot; then&lt;br /&gt;
        if not value or value:match(&amp;quot;^%d%d%d%d$&amp;quot;) == nil then&lt;br /&gt;
            return nil, &amp;quot;INVALID_ARTICLE_ID&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return link(EN_TTT .. &amp;quot;?art=&amp;quot; .. value .. &amp;quot;&amp;amp;mode=artikelopslag&amp;quot;, &amp;quot;Article &amp;quot; .. value .. &amp;quot; — English online text if available&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    if lowered == &amp;quot;lecture&amp;quot; or lowered == &amp;quot;lectures&amp;quot; or lowered == &amp;quot;foredrag&amp;quot; then&lt;br /&gt;
        if not is_integer(value) then&lt;br /&gt;
            return nil, &amp;quot;INVALID_LECTURE_ID&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return link(DA_LECTURES .. &amp;quot;?nr=&amp;quot; .. value, &amp;quot;Lecture &amp;quot; .. value .. &amp;quot; — Danish original; English translation not confirmed&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    if lowered == &amp;quot;kosmos&amp;quot; then&lt;br /&gt;
        if not value then&lt;br /&gt;
            return nil, &amp;quot;MISSING_KOSMOS_DESCRIPTION&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        return text(&amp;quot;Kosmos: &amp;quot; .. value .. &amp;quot; — Danish original; no direct online-library link confirmed&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    return nil, &amp;quot;UNKNOWN_SOURCE_KIND&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function render_reference(argument_frame)&lt;br /&gt;
    local values, collect_error, collect_detail = collect_args(argument_frame)&lt;br /&gt;
    if not values then&lt;br /&gt;
        return error_message(collect_error, collect_detail)&lt;br /&gt;
    end&lt;br /&gt;
    local pos, positional_error = positional(values)&lt;br /&gt;
    if not pos then&lt;br /&gt;
        return error_message(positional_error)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local work = values.work or values.source&lt;br /&gt;
    local section = values.section&lt;br /&gt;
    local subsection = values.subsection&lt;br /&gt;
    local kind = values.kind&lt;br /&gt;
&lt;br /&gt;
    if values.work and values.source then&lt;br /&gt;
        return error_message(&amp;quot;DUPLICATE_WORK_ARGUMENTS&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    if values.section and pos[2] then&lt;br /&gt;
        return error_message(&amp;quot;DUPLICATE_SECTION_ARGUMENT&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    if values.subsection and pos[3] then&lt;br /&gt;
        return error_message(&amp;quot;DUPLICATE_SUBSECTION_ARGUMENT&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if kind then&lt;br /&gt;
        if pos[2] or pos[3] or work or section or subsection then&lt;br /&gt;
            return error_message(&amp;quot;MIXED_REFERENCE_FORMS&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        local special_result, special_error = render_special(kind, pos[1] or values[&amp;quot;1&amp;quot;])&lt;br /&gt;
        if not special_result then&lt;br /&gt;
            return error_message(special_error)&lt;br /&gt;
        end&lt;br /&gt;
        return special_result&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if work and pos[1] then&lt;br /&gt;
        return error_message(&amp;quot;MIXED_REFERENCE_FORMS&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if work then&lt;br /&gt;
        section = section or pos[2]&lt;br /&gt;
        subsection = subsection or pos[3]&lt;br /&gt;
    else&lt;br /&gt;
        work = pos[1]&lt;br /&gt;
        section = section or pos[2]&lt;br /&gt;
        subsection = subsection or pos[3]&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if not work then&lt;br /&gt;
        return error_message(&amp;quot;MISSING_PRIMARY_ARGUMENT&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if is_integer(work) then&lt;br /&gt;
        if section and subsection then&lt;br /&gt;
            return error_message(&amp;quot;DUPLICATE_SUBSECTION_ARGUMENT&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        if section and not is_integer(section) then&lt;br /&gt;
            return error_message(&amp;quot;INVALID_SUBSECTION&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        local book = find_book_for_section(work)&lt;br /&gt;
        if not book then&lt;br /&gt;
            return error_message(&amp;quot;SECTION_OUT_OF_RANGE&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        -- For numeric shorthand the second value is the subsection.  Accept&lt;br /&gt;
        -- either positional 2 or the named subsection form, but never discard&lt;br /&gt;
        -- a third positional value.&lt;br /&gt;
        local numeric_subsection = subsection or section&lt;br /&gt;
        local result, render_error = book_reference(book, work, numeric_subsection)&lt;br /&gt;
        if not result then&lt;br /&gt;
            return error_message(render_error)&lt;br /&gt;
        end&lt;br /&gt;
        return result&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if work:lower() == &amp;quot;e&amp;quot; or work:lower() == &amp;quot;epilogue&amp;quot; then&lt;br /&gt;
        if section or subsection then&lt;br /&gt;
            return error_message(&amp;quot;UNEXPECTED_EPILOGUE_ARGUMENT&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        local book = BOOKS.LB7&lt;br /&gt;
        return link(book_url(book, &amp;quot;2665&amp;quot;), &amp;quot;Livets Bog 7, epilogue (section 2665) — Danish original; no English translation confirmed&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local special_kind = work:lower()&lt;br /&gt;
    if special_kind == &amp;quot;symbol&amp;quot; or special_kind == &amp;quot;symbols&amp;quot;&lt;br /&gt;
        or special_kind == &amp;quot;article&amp;quot; or special_kind == &amp;quot;articles&amp;quot;&lt;br /&gt;
        or special_kind == &amp;quot;lecture&amp;quot; or special_kind == &amp;quot;lectures&amp;quot;&lt;br /&gt;
        or special_kind == &amp;quot;foredrag&amp;quot; or special_kind == &amp;quot;kosmos&amp;quot; then&lt;br /&gt;
        if subsection then&lt;br /&gt;
            return error_message(&amp;quot;TOO_MANY_SOURCE_ARGUMENTS&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
        local special_result, special_error = render_special(work, section)&lt;br /&gt;
        if not special_result then&lt;br /&gt;
            return error_message(special_error)&lt;br /&gt;
        end&lt;br /&gt;
        return special_result&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local result, render_error = render_book(work, section, subsection)&lt;br /&gt;
    if not result then&lt;br /&gt;
        return error_message(render_error)&lt;br /&gt;
    end&lt;br /&gt;
    return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.render(frame)&lt;br /&gt;
    return render_reference(frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.ref(frame)&lt;br /&gt;
    local parent = frame and frame:getParent()&lt;br /&gt;
    local content = render_reference(parent)&lt;br /&gt;
    local has_error_category = content:sub(-#ERROR_CATEGORY) == ERROR_CATEGORY&lt;br /&gt;
    if has_error_category then&lt;br /&gt;
        -- Category links inside a Cite extension tag are not reliably attached&lt;br /&gt;
        -- to the page. Keep the error text in the note, but emit the marker&lt;br /&gt;
        -- outside the tag so the maintenance category is authoritative.&lt;br /&gt;
        content = content:sub(1, -#ERROR_CATEGORY - 1)&lt;br /&gt;
    end&lt;br /&gt;
    local reference = frame:extensionTag(&amp;quot;ref&amp;quot;, content)&lt;br /&gt;
    if has_error_category then&lt;br /&gt;
        reference = reference .. ERROR_CATEGORY&lt;br /&gt;
    end&lt;br /&gt;
    return reference&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Wikiboteng@Wikiboteng</name></author>
	</entry>
</feed>