<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://olddev.minetest.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Poetry</id>
	<title>Old MT Dev - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://olddev.minetest.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Poetry"/>
	<link rel="alternate" type="text/html" href="https://olddev.minetest.org/Special:Contributions/Poetry"/>
	<updated>2026-04-15T17:02:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.7</generator>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=574</id>
		<title>Minetest.place schematic on vmanip</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=574"/>
		<updated>2023-08-05T22:49:44Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UnofficialLua}}&lt;br /&gt;
{{DISPLAYTITLE:minetest.place_schematic_on_vmanip}}&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source&amp;gt;minetest.place_schematic_on_vmanip(vm, pos, schematic, rotation, replacements, force_placement)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This method works in a similar fashion to minetest.place_schematic, but can be used with a [[VoxelManip]] for better performance when manipulating large amounts of nodes.&lt;br /&gt;
&lt;br /&gt;
* Uses VoxelManip object vm, which is the voxel manipulator you are using to e.g. generate terrain&lt;br /&gt;
* Places the schematic specified by schematic (see: Schematic specifier) at pos.&lt;br /&gt;
* Rotation can be &amp;quot;0&amp;quot;, &amp;quot;90&amp;quot;, &amp;quot;180&amp;quot;, &amp;quot;270&amp;quot;, or &amp;quot;random&amp;quot;.&lt;br /&gt;
* If the rotation parameter is omitted, the schematic is not rotated.&lt;br /&gt;
* replacements = {[&amp;quot;old_name&amp;quot;] = &amp;quot;convert_to&amp;quot;, ...}&lt;br /&gt;
* force_placement is a boolean indicating whether nodes other than air and ignore are replaced by the schematic&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|Schematics are volumes and the position where you place the schematic is the corner of the schematic. If for example you have a 5 by 5 by 5 schematic of a tree whose trunk is in the middle, you will need to offset the x and z position by -2. If you don't, you risk misplacing the tree causing them to float in the air or be generated inside blocks on e.g. steep slopes.}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;source&amp;gt;local data = {}&lt;br /&gt;
local vm, emin, emax = minetest.get_mapgen_object(&amp;quot;voxelmanip&amp;quot;)&lt;br /&gt;
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
-- E.g. terrain generation code here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Decoration&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		local ivm = area:index(x, minp.y-1, z)&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
		    if data[ivm] == minetest.get_content_id(&amp;quot;default:dirt_with_dry_grass&amp;quot;) and math.random(0, 500) then&lt;br /&gt;
			-- We place the tree if there is grass with dirt, but we could also have retrieved the y from the&lt;br /&gt;
			-- terrain heightmap in which case we would not necessarily have to loop from minp.y to maxp.y again &lt;br /&gt;
			minetest.place_schematic_on_vmanip(vm, { x = x - 4, y = y, z = z - 4},&lt;br /&gt;
								   minetest.get_modpath(&amp;quot;default&amp;quot;)..&amp;quot;/schematics/acacia_tree.mts&amp;quot;,&lt;br /&gt;
&amp;quot;random&amp;quot;, nil, false)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|If you place schematics while performing the vmanip of e.g. the terrain from negative y to positive y, you may need to separate your terrain generation loop from the schematic placement loop or risk the schematics to be overwritten}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Methods|p]]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=573</id>
		<title>MediaWiki:Monobook.css</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=573"/>
		<updated>2023-08-05T22:49:13Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* All CSS here will be loaded for users of the MonoBook skin */&lt;br /&gt;
&lt;br /&gt;
.mw-wiki-logo {&lt;br /&gt;
    background-size: contain;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-content-text, .mw-body-content {&lt;br /&gt;
    font-size: 1.1em;&lt;br /&gt;
    text-align: justify;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.code, .source {&lt;br /&gt;
   display:block;&lt;br /&gt;
   background: rgb(90%, 90%, 90%);&lt;br /&gt;
   -webkit-overflow-scrolling: touch;&lt;br /&gt;
   overflow-x: scroll;&lt;br /&gt;
   border-radius: .5em;&lt;br /&gt;
   border: 2px solid darkgray;&lt;br /&gt;
   color: black;&lt;br /&gt;
   white-space: pre;&lt;br /&gt;
   max-width: 100%;&lt;br /&gt;
   min-width: 50em;&lt;br /&gt;
   padding: 1em;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=572</id>
		<title>Minetest.place schematic on vmanip</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=572"/>
		<updated>2023-08-05T22:04:15Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UnofficialLua}}&lt;br /&gt;
{{DISPLAYTITLE:minetest.place_schematic_on_vmanip}}&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source&amp;gt;minetest.place_schematic_on_vmanip(vm, pos, schematic, rotation, replacements, force_placement)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This method works in a similar fashion to minetest.place_schematic, but can be used with a [[VoxelManip]] for better performance when manipulating large amounts of nodes.&lt;br /&gt;
&lt;br /&gt;
* Uses VoxelManip object vm, which is the voxel manipulator you are using to e.g. generate terrain&lt;br /&gt;
* Places the schematic specified by schematic (see: Schematic specifier) at pos.&lt;br /&gt;
* Rotation can be &amp;quot;0&amp;quot;, &amp;quot;90&amp;quot;, &amp;quot;180&amp;quot;, &amp;quot;270&amp;quot;, or &amp;quot;random&amp;quot;.&lt;br /&gt;
* If the rotation parameter is omitted, the schematic is not rotated.&lt;br /&gt;
* replacements = {[&amp;quot;old_name&amp;quot;] = &amp;quot;convert_to&amp;quot;, ...}&lt;br /&gt;
* force_placement is a boolean indicating whether nodes other than air and ignore are replaced by the schematic&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|Schematics are volumes and the position where you place the schematic is the corner of the schematic. If for example you have a 5 by 5 by 5 schematic of a tree whose trunk is in the middle, you will need to offset the x and z position by -2. If you don't, you risk misplacing the tree causing them to float in the air or be generated inside blocks on e.g. steep slopes.}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;code&amp;gt;local data = {}&lt;br /&gt;
local vm, emin, emax = minetest.get_mapgen_object(&amp;quot;voxelmanip&amp;quot;)&lt;br /&gt;
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
-- E.g. terrain generation code here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Decoration&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		local ivm = area:index(x, minp.y-1, z)&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
		    if data[ivm] == minetest.get_content_id(&amp;quot;default:dirt_with_dry_grass&amp;quot;) and math.random(0, 500) then&lt;br /&gt;
			-- We place the tree if there is grass with dirt, but we could also have retrieved the y from the&lt;br /&gt;
			-- terrain heightmap in which case we would not necessarily have to loop from minp.y to maxp.y again &lt;br /&gt;
			minetest.place_schematic_on_vmanip(vm, { x = x - 4, y = y, z = z - 4},&lt;br /&gt;
								   minetest.get_modpath(&amp;quot;default&amp;quot;)..&amp;quot;/schematics/acacia_tree.mts&amp;quot;,&lt;br /&gt;
&amp;quot;random&amp;quot;, nil, false)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|If you place schematics while performing the vmanip of e.g. the terrain from negative y to positive y, you may need to separate your terrain generation loop from the schematic placement loop or risk the schematics to be overwritten}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Methods|p]]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=571</id>
		<title>MediaWiki:Monobook.css</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=571"/>
		<updated>2023-08-05T22:02:15Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* All CSS here will be loaded for users of the MonoBook skin */&lt;br /&gt;
&lt;br /&gt;
.mw-wiki-logo {&lt;br /&gt;
    background-size: contain;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-content-text, .mw-body-content {&lt;br /&gt;
    font-size: 1.1em;&lt;br /&gt;
    text-align: justify;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.code {&lt;br /&gt;
   display:block;&lt;br /&gt;
   background: rgb(90%, 90%, 90%);&lt;br /&gt;
   -webkit-overflow-scrolling: touch;&lt;br /&gt;
   overflow-x: scroll;&lt;br /&gt;
   border-radius: .5em;&lt;br /&gt;
   border: 2px solid darkgray;&lt;br /&gt;
   color: black;&lt;br /&gt;
   white-space: pre;&lt;br /&gt;
   max-width: 100%;&lt;br /&gt;
   min-width: 50em;&lt;br /&gt;
   padding: 1em;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=570</id>
		<title>Minetest.place schematic on vmanip</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=570"/>
		<updated>2023-08-05T22:01:57Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UnofficialLua}}&lt;br /&gt;
{{DISPLAYTITLE:minetest.place_schematic_on_vmanip}}&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source&amp;gt;minetest.place_schematic_on_vmanip(vm, pos, schematic, rotation, replacements, force_placement)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This method works in a similar fashion to minetest.place_schematic, but can be used with a [[VoxelManip]] for better performance when manipulating large amounts of nodes.&lt;br /&gt;
&lt;br /&gt;
* Uses VoxelManip object vm, which is the voxel manipulator you are using to e.g. generate terrain&lt;br /&gt;
* Places the schematic specified by schematic (see: Schematic specifier) at pos.&lt;br /&gt;
* Rotation can be &amp;quot;0&amp;quot;, &amp;quot;90&amp;quot;, &amp;quot;180&amp;quot;, &amp;quot;270&amp;quot;, or &amp;quot;random&amp;quot;.&lt;br /&gt;
* If the rotation parameter is omitted, the schematic is not rotated.&lt;br /&gt;
* replacements = {[&amp;quot;old_name&amp;quot;] = &amp;quot;convert_to&amp;quot;, ...}&lt;br /&gt;
* force_placement is a boolean indicating whether nodes other than air and ignore are replaced by the schematic&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|Schematics are volumes and the position where you place the schematic is the corner of the schematic. If for example you have a 5 by 5 by 5 schematic of a tree whose trunk is in the middle, you will need to offset the x and z position by -2. If you don't, you risk misplacing the tree causing them to float in the air or be generated inside blocks on e.g. steep slopes.}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
local data = {}&lt;br /&gt;
local vm, emin, emax = minetest.get_mapgen_object(&amp;quot;voxelmanip&amp;quot;)&lt;br /&gt;
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
-- E.g. terrain generation code here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Decoration&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		local ivm = area:index(x, minp.y-1, z)&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
			if data[ivm] == minetest.get_content_id(&amp;quot;default:dirt_with_dry_grass&amp;quot;) and math.random(0, 500) then&lt;br /&gt;
				-- We place the tree if there is grass with dirt, but we could also have retrieved the y from the&lt;br /&gt;
				-- terrain heightmap in which case we would not necessarily have to loop from minp.y to maxp.y again &lt;br /&gt;
				minetest.place_schematic_on_vmanip(vm, { x = x - 4, y = y, z = z - 4},&lt;br /&gt;
								   minetest.get_modpath(&amp;quot;default&amp;quot;)..&amp;quot;/schematics/acacia_tree.mts&amp;quot;,&lt;br /&gt;
								   &amp;quot;random&amp;quot;, nil, false)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|If you place schematics while performing the vmanip of e.g. the terrain from negative y to positive y, you may need to separate your terrain generation loop from the schematic placement loop or risk the schematics to be overwritten}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Methods|p]]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Template:Code&amp;diff=569</id>
		<title>Template:Code</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Template:Code&amp;diff=569"/>
		<updated>2023-08-05T22:01:24Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=568</id>
		<title>Minetest.place schematic on vmanip</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=568"/>
		<updated>2023-08-05T22:00:40Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UnofficialLua}}&lt;br /&gt;
{{DISPLAYTITLE:minetest.place_schematic_on_vmanip}}&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source&amp;gt;minetest.place_schematic_on_vmanip(vm, pos, schematic, rotation, replacements, force_placement)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This method works in a similar fashion to minetest.place_schematic, but can be used with a [[VoxelManip]] for better performance when manipulating large amounts of nodes.&lt;br /&gt;
&lt;br /&gt;
* Uses VoxelManip object vm, which is the voxel manipulator you are using to e.g. generate terrain&lt;br /&gt;
* Places the schematic specified by schematic (see: Schematic specifier) at pos.&lt;br /&gt;
* Rotation can be &amp;quot;0&amp;quot;, &amp;quot;90&amp;quot;, &amp;quot;180&amp;quot;, &amp;quot;270&amp;quot;, or &amp;quot;random&amp;quot;.&lt;br /&gt;
* If the rotation parameter is omitted, the schematic is not rotated.&lt;br /&gt;
* replacements = {[&amp;quot;old_name&amp;quot;] = &amp;quot;convert_to&amp;quot;, ...}&lt;br /&gt;
* force_placement is a boolean indicating whether nodes other than air and ignore are replaced by the schematic&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|Schematics are volumes and the position where you place the schematic is the corner of the schematic. If for example you have a 5 by 5 by 5 schematic of a tree whose trunk is in the middle, you will need to offset the x and z position by -2. If you don't, you risk misplacing the tree causing them to float in the air or be generated inside blocks on e.g. steep slopes.}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The below snippet places the acacia tree from default at some terrain position with a random rotation when the data written at the voxelmanip index is dirt with dry grass. It&lt;br /&gt;
 &lt;br /&gt;
{{code&lt;br /&gt;
local data = {}&lt;br /&gt;
local vm, emin, emax = minetest.get_mapgen_object(&amp;quot;voxelmanip&amp;quot;)&lt;br /&gt;
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
-- E.g. terrain generation code here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Decoration&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		local ivm = area:index(x, minp.y-1, z)&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
			if data[ivm] == minetest.get_content_id(&amp;quot;default:dirt_with_dry_grass&amp;quot;) and math.random(0, 500) then&lt;br /&gt;
				-- We place the tree if there is grass with dirt, but we could also have retrieved the y from the&lt;br /&gt;
				-- terrain heightmap in which case we would not necessarily have to loop from minp.y to maxp.y again &lt;br /&gt;
				minetest.place_schematic_on_vmanip(vm, { x = x - 4, y = y, z = z - 4},&lt;br /&gt;
								   minetest.get_modpath(&amp;quot;default&amp;quot;)..&amp;quot;/schematics/acacia_tree.mts&amp;quot;,&lt;br /&gt;
								   &amp;quot;random&amp;quot;, nil, false)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|If you place schematics while performing the vmanip of e.g. the terrain from negative y to positive y, you may need to separate your terrain generation loop from the schematic placement loop or risk the schematics to be overwritten}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Methods|p]]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=567</id>
		<title>MediaWiki:Monobook.css</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=567"/>
		<updated>2023-08-05T21:59:18Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* All CSS here will be loaded for users of the MonoBook skin */&lt;br /&gt;
&lt;br /&gt;
.mw-wiki-logo {&lt;br /&gt;
    background-size: contain;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-content-text, .mw-body-content {&lt;br /&gt;
    font-size: 1.1em;&lt;br /&gt;
    text-align: justify;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
code {&lt;br /&gt;
   display:block;&lt;br /&gt;
   background: rgb(90%, 90%, 90%);&lt;br /&gt;
   -webkit-overflow-scrolling: touch;&lt;br /&gt;
   overflow-x: scroll;&lt;br /&gt;
   border-radius: .5em;&lt;br /&gt;
   border: 2px solid darkgray;&lt;br /&gt;
   color: black;&lt;br /&gt;
   white-space: pre;&lt;br /&gt;
   max-width: 100%;&lt;br /&gt;
   min-width: 50em;&lt;br /&gt;
   padding: 1em;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=566</id>
		<title>Minetest.place schematic on vmanip</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=566"/>
		<updated>2023-08-05T21:55:07Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UnofficialLua}}&lt;br /&gt;
{{DISPLAYTITLE:minetest.place_schematic_on_vmanip}}&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source&amp;gt;minetest.place_schematic_on_vmanip(vm, pos, schematic, rotation, replacements, force_placement)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This method works in a similar fashion to minetest.place_schematic, but can be used with a [[VoxelManip]] for better performance when manipulating large amounts of nodes.&lt;br /&gt;
&lt;br /&gt;
* Uses VoxelManip object vm, which is the voxel manipulator you are using to e.g. generate terrain&lt;br /&gt;
* Places the schematic specified by schematic (see: Schematic specifier) at pos.&lt;br /&gt;
* Rotation can be &amp;quot;0&amp;quot;, &amp;quot;90&amp;quot;, &amp;quot;180&amp;quot;, &amp;quot;270&amp;quot;, or &amp;quot;random&amp;quot;.&lt;br /&gt;
* If the rotation parameter is omitted, the schematic is not rotated.&lt;br /&gt;
* replacements = {[&amp;quot;old_name&amp;quot;] = &amp;quot;convert_to&amp;quot;, ...}&lt;br /&gt;
* force_placement is a boolean indicating whether nodes other than air and ignore are replaced by the schematic&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|Schematics are volumes and the position where you place the schematic is the corner of the schematic. If for example you have a 5 by 5 by 5 schematic of a tree whose trunk is in the middle, you will need to offset the x and z position by -2. If you don't, you risk misplacing the tree causing them to float in the air or be generated inside blocks on e.g. steep slopes.}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The below snippet places the acacia tree from default at some terrain position with a random rotation when the data written at the voxelmanip index is dirt with dry grass. It&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
local data = {}&lt;br /&gt;
local vm, emin, emax = minetest.get_mapgen_object(&amp;quot;voxelmanip&amp;quot;)&lt;br /&gt;
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
-- E.g. terrain generation code here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Decoration&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		local ivm = area:index(x, minp.y-1, z)&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
			if data[ivm] == minetest.get_content_id(&amp;quot;default:dirt_with_dry_grass&amp;quot;) and math.random(0, 500) then&lt;br /&gt;
				-- We place the tree if there is grass with dirt, but we could also have retrieved the y from the&lt;br /&gt;
				-- terrain heightmap in which case we would not necessarily have to loop from minp.y to maxp.y again &lt;br /&gt;
				minetest.place_schematic_on_vmanip(vm, { x = x - 4, y = y, z = z - 4},&lt;br /&gt;
								   minetest.get_modpath(&amp;quot;default&amp;quot;)..&amp;quot;/schematics/acacia_tree.mts&amp;quot;,&lt;br /&gt;
								   &amp;quot;random&amp;quot;, nil, false)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|If you place schematics while performing the vmanip of e.g. the terrain from negative y to positive y, you may need to separate your terrain generation loop from the schematic placement loop or risk the schematics to be overwritten}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Methods|p]]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Module:Arguments&amp;diff=565</id>
		<title>Module:Arguments</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Module:Arguments&amp;diff=565"/>
		<updated>2023-08-05T21:43:55Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Created page with &amp;quot;local p = {}  function p.getArgs(frame, options)     options = options or {}     local metatable = {}     function metatable:__index(key)         local arg = frame.args[key]         if arg == nil and options.inherited then             local parent = frame:getParent()             arg = parent and parent.args[key] or nil         end         return arg     end     return setmetatable({}, metatable) end  function p.makeInvokeFunc(func, options)     return function(frame)...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.getArgs(frame, options)&lt;br /&gt;
    options = options or {}&lt;br /&gt;
    local metatable = {}&lt;br /&gt;
    function metatable:__index(key)&lt;br /&gt;
        local arg = frame.args[key]&lt;br /&gt;
        if arg == nil and options.inherited then&lt;br /&gt;
            local parent = frame:getParent()&lt;br /&gt;
            arg = parent and parent.args[key] or nil&lt;br /&gt;
        end&lt;br /&gt;
        return arg&lt;br /&gt;
    end&lt;br /&gt;
    return setmetatable({}, metatable)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeInvokeFunc(func, options)&lt;br /&gt;
    return function(frame)&lt;br /&gt;
        local args = p.getArgs(frame, options)&lt;br /&gt;
        if (options.passFrameParam) then&lt;br /&gt;
            return func(frame, args)&lt;br /&gt;
        end&lt;br /&gt;
        return func(args)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Template:Codenowiki%26action%3Dedit&amp;diff=564</id>
		<title>Template:Codenowiki&amp;action=edit</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Template:Codenowiki%26action%3Dedit&amp;diff=564"/>
		<updated>2023-08-05T21:42:52Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Created page with &amp;quot;&amp;lt;onlyinclude&amp;gt;&amp;lt;code&amp;gt;{{{{{|safesubst:}}}nowiki|{{{1}}}}}&amp;lt;/code&amp;gt;&amp;lt;/onlyinclude&amp;gt; {{Documentation}}&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&amp;lt;code&amp;gt;{{{{{|safesubst:}}}nowiki|{{{1}}}}}&amp;lt;/code&amp;gt;&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=563</id>
		<title>Minetest.place schematic on vmanip</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=563"/>
		<updated>2023-08-05T21:39:46Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UnofficialLua}}&lt;br /&gt;
{{DISPLAYTITLE:minetest.place_schematic_on_vmanip}}&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source&amp;gt;minetest.place_schematic_on_vmanip(vm, pos, schematic, rotation, replacements, force_placement)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This method works in a similar fashion to minetest.place_schematic, but can be used with a [[VoxelManip]] for better performance when manipulating large amounts of nodes.&lt;br /&gt;
&lt;br /&gt;
* Uses VoxelManip object vm, which is the voxel manipulator you are using to e.g. generate terrain&lt;br /&gt;
* Places the schematic specified by schematic (see: Schematic specifier) at pos.&lt;br /&gt;
* Rotation can be &amp;quot;0&amp;quot;, &amp;quot;90&amp;quot;, &amp;quot;180&amp;quot;, &amp;quot;270&amp;quot;, or &amp;quot;random&amp;quot;.&lt;br /&gt;
* If the rotation parameter is omitted, the schematic is not rotated.&lt;br /&gt;
* replacements = {[&amp;quot;old_name&amp;quot;] = &amp;quot;convert_to&amp;quot;, ...}&lt;br /&gt;
* force_placement is a boolean indicating whether nodes other than air and ignore are replaced by the schematic&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|Schematics are volumes and the position where you place the schematic is the corner of the schematic. If for example you have a 5 by 5 by 5 schematic of a tree whose trunk is in the middle, you will need to offset the x and z position by -2. If you don't, you risk misplacing the tree causing them to float in the air or be generated inside blocks on e.g. steep slopes.}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The below snippet places the acacia tree from default at some terrain position with a random rotation when the data written at the voxelmanip index is dirt with dry grass. It&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
local data = {}&lt;br /&gt;
local vm, emin, emax = minetest.get_mapgen_object(&amp;quot;voxelmanip&amp;quot;)&lt;br /&gt;
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
-- E.g. terrain generation code here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Decoration&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		local ivm = area:index(x, minp.y-1, z)&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
			if data[ivm] == minetest.get_content_id(&amp;quot;default:dirt_with_dry_grass&amp;quot;) and math.random(0, 500) then&lt;br /&gt;
				-- We place the tree if there is grass with dirt, but we could also have retrieved the y from the&lt;br /&gt;
				-- terrain heightmap in which case we would not necessarily have to loop from minp.y to maxp.y again &lt;br /&gt;
				minetest.place_schematic_on_vmanip(vm, { x = x - 4, y = y, z = z - 4},&lt;br /&gt;
								   minetest.get_modpath(&amp;quot;default&amp;quot;)..&amp;quot;/schematics/acacia_tree.mts&amp;quot;,&lt;br /&gt;
								   &amp;quot;random&amp;quot;, nil, false)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|If you place schematics while performing the vmanip of e.g. the terrain from negative y to positive y, you may need to separate your terrain generation loop from the schematic placement loop or risk the schematics to be overwritten}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Methods|p]]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=562</id>
		<title>MediaWiki:Monobook.css</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=562"/>
		<updated>2023-08-05T21:38:44Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* All CSS here will be loaded for users of the MonoBook skin */&lt;br /&gt;
&lt;br /&gt;
.mw-wiki-logo {&lt;br /&gt;
    background-size: contain;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-content-text, .mw-body-content {&lt;br /&gt;
    font-size: 1.1em;&lt;br /&gt;
    text-align: justify;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
source {&lt;br /&gt;
display: block;&lt;br /&gt;
background: none;&lt;br /&gt;
white-space: pre;&lt;br /&gt;
-webkit-overflow-scrolling: touch;&lt;br /&gt;
overflow-x: scroll;&lt;br /&gt;
max-width: 100%;&lt;br /&gt;
min-width: 100px;&lt;br /&gt;
padding: 0;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Module:Lua_banner&amp;diff=561</id>
		<title>Module:Lua banner</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Module:Lua_banner&amp;diff=561"/>
		<updated>2023-08-05T21:36:27Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Created page with &amp;quot;-- This module implements the {{lua}} template.  local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageBox = require('Module:Message box') local TNT = require('Module:TNT')  local p = {}  local function format(msg) 	return TNT.format('I18n/Lua banner', msg) end  local function getConfig() 	return mw.loadData('Module:Lua banner/config') end  function p.main(frame) 	local origArgs = frame:g...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements the {{lua}} template.&lt;br /&gt;
&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
local mList = require('Module:List')&lt;br /&gt;
local mTableTools = require('Module:TableTools')&lt;br /&gt;
local mMessageBox = require('Module:Message box')&lt;br /&gt;
local TNT = require('Module:TNT')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function format(msg)&lt;br /&gt;
	return TNT.format('I18n/Lua banner', msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getConfig()&lt;br /&gt;
	return mw.loadData('Module:Lua banner/config')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local origArgs = frame:getParent().args&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(origArgs) do&lt;br /&gt;
		v = v:match('^%s*(.-)%s*$')&lt;br /&gt;
		if v ~= '' then&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args, cfg)&lt;br /&gt;
	local modules = mTableTools.compressSparseArray(args)&lt;br /&gt;
	local box = p.renderBox(modules, cfg, args)&lt;br /&gt;
	local trackingCategories = p.renderTrackingCategories(args, modules, nil, cfg)&lt;br /&gt;
	return box .. trackingCategories&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderBox(modules, cfg, args)&lt;br /&gt;
	local boxArgs = {}&lt;br /&gt;
	if #modules &amp;lt; 1 then&lt;br /&gt;
		cfg = cfg or getConfig()&lt;br /&gt;
		if cfg['allow_wishes'] or yesno(args and args.wish) then&lt;br /&gt;
			boxArgs.text = format('wishtext')&lt;br /&gt;
		else&lt;br /&gt;
			boxArgs.text = string.format('&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;%s&amp;lt;/strong&amp;gt;', format('error_emptylist'))&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local moduleLinks = {}&lt;br /&gt;
		for i, module in ipairs(modules) do&lt;br /&gt;
			moduleLinks[i] = string.format('[[:%s]]', module)&lt;br /&gt;
		end&lt;br /&gt;
		local moduleList = mList.makeList('bulleted', moduleLinks)&lt;br /&gt;
		boxArgs.text = format('header') .. '\n' .. moduleList&lt;br /&gt;
	end&lt;br /&gt;
	boxArgs.type = 'notice'&lt;br /&gt;
	boxArgs.small = true&lt;br /&gt;
	boxArgs.image = string.format(&lt;br /&gt;
		'[[File:Lua-logo-nolabel.svg|30px|alt=%s|link=%s]]',&lt;br /&gt;
		format('logo_alt'),&lt;br /&gt;
		format('logo_link')&lt;br /&gt;
	)&lt;br /&gt;
	return mMessageBox.main('mbox', boxArgs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderTrackingCategories(args, modules, titleObj, cfg)&lt;br /&gt;
	if yesno(args.nocat) then&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	cfg = cfg or getConfig()&lt;br /&gt;
	&lt;br /&gt;
	local cats = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Error category&lt;br /&gt;
	if #modules &amp;lt; 1 and not (cfg['allow_wishes'] or yesno(args.wish)) and cfg['error_category'] then&lt;br /&gt;
		cats[#cats + 1] = cfg['error_category']&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Lua templates category&lt;br /&gt;
	titleObj = titleObj or mw.title.getCurrentTitle()&lt;br /&gt;
	if titleObj.namespace == 10 &lt;br /&gt;
		and not cfg['subpage_blacklist'][titleObj.subpageText]&lt;br /&gt;
	then&lt;br /&gt;
		local category = args.category&lt;br /&gt;
		if not category then&lt;br /&gt;
			local pagename = modules[1] and mw.title.new(modules[1])&lt;br /&gt;
			category = pagename and cfg['module_categories'][pagename.text]&lt;br /&gt;
			if not category then&lt;br /&gt;
				if (cfg['allow_wishes'] or yesno(args.wish)) and #modules &amp;lt; 1 then&lt;br /&gt;
					category = cfg['wish_category']&lt;br /&gt;
				else&lt;br /&gt;
					category = cfg['default_category']&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if category then&lt;br /&gt;
			cats[#cats + 1] = category&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for i, cat in ipairs(cats) do&lt;br /&gt;
		cats[i] = string.format('[[Category:%s]]', cat)&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(cats)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Module:Documentation&amp;diff=560</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Module:Documentation&amp;diff=560"/>
		<updated>2023-08-05T21:34:45Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Created page with &amp;quot;-- This module implements {{documentation}}.  -- Get required modules. local getArgs = require('Module:Arguments').getArgs local messageBox = require('Module:Message box')  -- Get the config table. local cfg = mw.loadData('Module:Documentation/config') local i18n = mw.loadData('Module:Documentation/i18n') local p = {}  -- Often-used functions. local ugsub = mw.ustring.gsub  ---------------------------------------------------------------------------- -- Helper functions -...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{documentation}}.&lt;br /&gt;
&lt;br /&gt;
-- Get required modules.&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
local messageBox = require('Module:Message box')&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData('Module:Documentation/config')&lt;br /&gt;
local i18n = mw.loadData('Module:Documentation/i18n')&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Often-used functions.&lt;br /&gt;
local ugsub = mw.ustring.gsub&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--&lt;br /&gt;
-- These are defined as local functions, but are made available in the p&lt;br /&gt;
-- table for testing purposes.&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function message(cfgKey, valArray, expectType)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Gets a message from the cfg table and formats it if appropriate.&lt;br /&gt;
	-- The function raises an error if the value from the cfg table is not&lt;br /&gt;
	-- of the type expectType. The default type for expectType is 'string'.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value 'Foo $2 bar $1.',&lt;br /&gt;
	-- message('foo-message', {'baz', 'qux'}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or 'string'&lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error(require('Module:TNT').format('I18n/Documentation', 'cfg-error-msg-type', cfgKey, expectType, type(msg)), 2)&lt;br /&gt;
	end&lt;br /&gt;
	if not valArray then&lt;br /&gt;
		return msg&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function getMessageVal(match)&lt;br /&gt;
		match = tonumber(match)&lt;br /&gt;
		return valArray[match] or error(require('Module:TNT').format('I18n/Documentation', 'cfg-error-msg-empty', '$' .. match, cfgKey), 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret = ugsub(msg, '$([1-9][0-9]*)', getMessageVal)&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.message = message&lt;br /&gt;
&lt;br /&gt;
local function makeWikilink(page, display)&lt;br /&gt;
	if display then&lt;br /&gt;
		return mw.ustring.format('[[%s|%s]]', page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format('[[%s]]', page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. ':' .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return mw.ustring.format('[%s %s]', url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select('#', ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	return '&amp;lt;small style=&amp;quot;font-style: normal;&amp;quot;&amp;gt;(' .. table.concat(ret, ' &amp;amp;#124; ') .. ')&amp;lt;/small&amp;gt;'&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == 'string' then&lt;br /&gt;
					value = value:match('^%s*(.-)%s*$') -- Remove whitespace.&lt;br /&gt;
					if key == 'heading' or value ~= '' then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Load TemplateStyles&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.main = function(frame)&lt;br /&gt;
	local parent = frame.getParent(frame)&lt;br /&gt;
	local output = p._main(parent.args)&lt;br /&gt;
	return frame:extensionTag{ name='templatestyles', args = { src= message('templatestyles-scr') } } .. output&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Main function&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function defines logic flow for the module.&lt;br /&gt;
	-- @args - table of arguments passed by the user&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'main-div-id' --&amp;gt; 'template-documentation'&lt;br /&gt;
	-- 'main-div-classes' --&amp;gt; 'template-documentation iezoomfix'&lt;br /&gt;
	--]]&lt;br /&gt;
	local env = p.getEnvironment(args)&lt;br /&gt;
	local root = mw.html.create()&lt;br /&gt;
	root&lt;br /&gt;
		:wikitext(p._getModuleWikitext(args, env))&lt;br /&gt;
		:wikitext(p.protectionTemplate(env))&lt;br /&gt;
		:wikitext(p.sandboxNotice(args, env))&lt;br /&gt;
		 -- This div tag is from {{documentation/start box}}, but moving it here&lt;br /&gt;
		 -- so that we don't have to worry about unclosed tags.&lt;br /&gt;
		:tag('div')&lt;br /&gt;
			:attr('id', message('main-div-id'))&lt;br /&gt;
			:addClass(message('main-div-class'))&lt;br /&gt;
			:wikitext(p._startBox(args, env))&lt;br /&gt;
			:wikitext(p._content(args, env))&lt;br /&gt;
			:done()&lt;br /&gt;
		:wikitext(p._endBox(args, env))&lt;br /&gt;
		:wikitext(p.addTrackingCategories(env))&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Environment settings&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.getEnvironment(args)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Returns a table with information about the environment, including title objects and other namespace- or&lt;br /&gt;
	-- path-related data.&lt;br /&gt;
	-- @args - table of arguments passed by the user&lt;br /&gt;
	--&lt;br /&gt;
	-- Title objects include:&lt;br /&gt;
	-- env.title - the page we are making documentation for (usually the current title)&lt;br /&gt;
	-- env.templateTitle - the template (or module, file, etc.)&lt;br /&gt;
	-- env.docTitle - the /doc subpage.&lt;br /&gt;
	-- env.sandboxTitle - the /sandbox subpage.&lt;br /&gt;
	-- env.testcasesTitle - the /testcases subpage.&lt;br /&gt;
	-- env.printTitle - the print version of the template, located at the /Print subpage.&lt;br /&gt;
	--&lt;br /&gt;
	-- Data includes:&lt;br /&gt;
	-- env.protectionLevels - the protection levels table of the title object.&lt;br /&gt;
	-- env.subjectSpace - the number of the title's subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don't call any of the functions&lt;br /&gt;
	-- more than once. (Nils won't be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. '/' .. message('doc-subpage')&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.printTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /Print subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'print-subpage' --&amp;gt; 'Print'&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message('print-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.protectionLevels()&lt;br /&gt;
		-- The protection levels table of the title object.&lt;br /&gt;
		return env.title.protectionLevels&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.subjectSpace()&lt;br /&gt;
		-- The subject namespace number.&lt;br /&gt;
		return mw.site.namespaces[env.title.namespace].subject.id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docSpace()&lt;br /&gt;
		-- The documentation namespace number. For most namespaces this is the same as the&lt;br /&gt;
		-- subject namespace. However, pages in the Article, File, MediaWiki or Category&lt;br /&gt;
		-- namespaces must have their /doc, /sandbox and /testcases pages in talk space.&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then&lt;br /&gt;
			return subjectSpace + 1&lt;br /&gt;
		else&lt;br /&gt;
			return subjectSpace&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docpageBase()&lt;br /&gt;
		-- The base page of the /doc, /sandbox, and /testcases subpages.&lt;br /&gt;
		-- For some namespaces this is the talk page, rather than the template page.&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local docSpace = env.docSpace&lt;br /&gt;
		local docSpaceText = mw.site.namespaces[docSpace].name&lt;br /&gt;
		-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.&lt;br /&gt;
		return docSpaceText .. ':' .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.fullUrl(&lt;br /&gt;
				'Special:ComparePages',&lt;br /&gt;
				{page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')&lt;br /&gt;
&lt;br /&gt;
function p._getModuleWikitext(args, env)&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if currentTitle.contentModel ~= 'Scribunto' then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don't care&lt;br /&gt;
	local moduleWikitext =  package.loaded[&amp;quot;Module:Module wikitext&amp;quot;]&lt;br /&gt;
	if moduleWikitext then&lt;br /&gt;
		return moduleWikitext.main()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sandboxNotice(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates a sandbox notice for display above sandbox pages.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'sandbox-notice-image' --&amp;gt; '[[Image:Sandbox.svg|50px|alt=|link=]]'&lt;br /&gt;
	-- 'sandbox-notice-blurb' --&amp;gt; 'This is the $1 for $2.'&lt;br /&gt;
	-- 'sandbox-notice-diff-blurb' --&amp;gt; 'This is the $1 for $2 ($3).'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-template' --&amp;gt; '[[w:Wikipedia:Template test cases|template sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-module' --&amp;gt; '[[w:Wikipedia:Template test cases|module sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-other' --&amp;gt; 'sandbox page'&lt;br /&gt;
	-- 'sandbox-notice-compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'sandbox-notice-testcases-blurb' --&amp;gt; 'See also the companion subpage for $1.'&lt;br /&gt;
	-- 'sandbox-notice-testcases-link-display' --&amp;gt; 'test cases'&lt;br /&gt;
	-- 'sandbox-category' --&amp;gt; 'Template sandboxes'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Build the table of arguments to pass to {{ombox}}. We need just two fields, &amp;quot;image&amp;quot; and &amp;quot;text&amp;quot;.&lt;br /&gt;
	local omargs = {}&lt;br /&gt;
	omargs.image = message('sandbox-notice-image')&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = ''&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	local isPreviewing = frame:preprocess('{{REVISIONID}}') == '' -- True if the page is being previewed.&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-template')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-module')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-other')&lt;br /&gt;
	end&lt;br /&gt;
	local templateLink = makeWikilink(templateTitle.prefixedText)&lt;br /&gt;
	local compareUrl = env.compareUrl&lt;br /&gt;
	if isPreviewing or not compareUrl then&lt;br /&gt;
		text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})&lt;br /&gt;
	else&lt;br /&gt;
		local compareDisplay = message('sandbox-notice-compare-link-display')&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})&lt;br /&gt;
	end&lt;br /&gt;
	-- Get the test cases page blurb if the page exists. This is something like&lt;br /&gt;
	-- &amp;quot;See also the companion subpage for [[Template:Foo/testcases|test cases]].&amp;quot;&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot; then&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-blurb', {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	text = text .. makeCategoryLink(message('sandbox-category'))&lt;br /&gt;
	omargs.text = text&lt;br /&gt;
	omargs.class = message('sandbox-class')&lt;br /&gt;
	local ret = '&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;'&lt;br /&gt;
	ret = ret .. messageBox.main('ombox', omargs)&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.protectionTemplate(env)&lt;br /&gt;
	-- Generates the padlock icon in the top right.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'protection-template' --&amp;gt; 'pp-template'&lt;br /&gt;
	-- 'protection-template-args' --&amp;gt; {docusage = 'yes'}&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local protectionLevels&lt;br /&gt;
	local protectionTemplate = message('protection-template')&lt;br /&gt;
	local namespace = title.namespace&lt;br /&gt;
	if not (protectionTemplate and (namespace == 10 or namespace == 828)) then&lt;br /&gt;
		-- Don't display the protection template if we are not in the template or module namespaces.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	protectionLevels = env.protectionLevels&lt;br /&gt;
	if not protectionLevels then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local editLevels = protectionLevels.edit&lt;br /&gt;
	local moveLevels = protectionLevels.move&lt;br /&gt;
	if moveLevels and moveLevels[1] == 'sysop' or editLevels and editLevels[1] then&lt;br /&gt;
		-- The page is full-move protected, or full, template, or semi-protected.&lt;br /&gt;
		local frame = mw.getCurrentFrame()&lt;br /&gt;
		return frame:expandTemplate{title = protectionTemplate, args = message('protection-template-args', nil, 'table')}&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Start box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.startBox = makeInvokeFunc('_startBox')&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content then&lt;br /&gt;
		-- No need to include the links if the documentation is on the template page itself.&lt;br /&gt;
		local linksData = p.makeStartBoxLinksData(args, env)&lt;br /&gt;
		if linksData then&lt;br /&gt;
			links = p.renderStartBoxLinks(linksData)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Generate the start box html.&lt;br /&gt;
	local data = p.makeStartBoxData(args, env, links)&lt;br /&gt;
	if data then&lt;br /&gt;
		return p.renderStartBox(data)&lt;br /&gt;
	else&lt;br /&gt;
		-- User specified no heading.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxLinksData(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Does initial processing of data to make the [view] [edit] [history] [purge] links.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'view-link-display' --&amp;gt; 'view'&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'purge-link-display' --&amp;gt; 'purge'&lt;br /&gt;
	-- 'file-docpage-preload' --&amp;gt; 'Template:Documentation/preload-filespace'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'docpage-preload' --&amp;gt; 'Template:Documentation/preload'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local data = {}&lt;br /&gt;
	data.title = title&lt;br /&gt;
	data.docTitle = docTitle&lt;br /&gt;
	-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
	data.viewLinkDisplay = i18n['view-link-display']&lt;br /&gt;
	data.editLinkDisplay = i18n['edit-link-display']&lt;br /&gt;
	data.historyLinkDisplay = i18n['history-link-display']&lt;br /&gt;
	data.purgeLinkDisplay = i18n['purge-link-display']&lt;br /&gt;
	-- Create link if /doc doesn't exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 6 then -- File namespace&lt;br /&gt;
			preload = message('file-docpage-preload')&lt;br /&gt;
		elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message('module-preload')&lt;br /&gt;
		else&lt;br /&gt;
			preload = message('docpage-preload')&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	data.preload = preload&lt;br /&gt;
	data.createLinkDisplay = i18n['create-link-display']&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBoxLinks(data)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the [view][edit][history][purge] or [create] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local function escapeBrackets(s)&lt;br /&gt;
		-- Escapes square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub('%[', '&amp;amp;#91;') -- Replace square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub('%]', '&amp;amp;#93;')&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	local title = data.title&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)&lt;br /&gt;
		local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)&lt;br /&gt;
		ret = '[%s] [%s] [%s] [%s]'&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		ret = '[%s]'&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, createLink)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'documentation-icon-wikitext' --&amp;gt; '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=Documentation icon]]'&lt;br /&gt;
	-- 'template-namespace-heading' --&amp;gt; 'Template documentation'&lt;br /&gt;
	-- 'module-namespace-heading' --&amp;gt; 'Module documentation'&lt;br /&gt;
	-- 'file-namespace-heading' --&amp;gt; 'Summary'&lt;br /&gt;
	-- 'other-namespaces-heading' --&amp;gt; 'Documentation'&lt;br /&gt;
	-- 'start-box-linkclasses' --&amp;gt; 'mw-editsection-like plainlinks'&lt;br /&gt;
	-- 'start-box-link-id' --&amp;gt; 'doc_editlinks'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == '' then&lt;br /&gt;
		-- Don't display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = i18n['template-namespace-heading']&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = i18n['module-namespace-heading']&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = i18n['file-namespace-heading']&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = i18n['other-namespaces-heading']&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Data for the [view][edit][history][purge] or [create] links.&lt;br /&gt;
	if links then&lt;br /&gt;
		data.linksClass = message('start-box-linkclasses')&lt;br /&gt;
		data.linksId = message('start-box-link-id')&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create('div')&lt;br /&gt;
	sbox&lt;br /&gt;
		:addClass(message('header-div-class'))&lt;br /&gt;
		:tag('div')&lt;br /&gt;
			:addClass(message('heading-div-class'))&lt;br /&gt;
			:wikitext(data.heading)&lt;br /&gt;
	local links = data.links&lt;br /&gt;
	if links then&lt;br /&gt;
		sbox&lt;br /&gt;
			:tag('div')&lt;br /&gt;
				:addClass(data.linksClass)&lt;br /&gt;
				:attr('id', data.linksId)&lt;br /&gt;
				:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc('_content')&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle}&lt;br /&gt;
	end&lt;br /&gt;
	-- The line breaks below are necessary so that &amp;quot;=== Headings ===&amp;quot; at the start and end&lt;br /&gt;
	-- of docs are interpreted correctly.&lt;br /&gt;
	local cbox = mw.html.create('div')&lt;br /&gt;
	cbox&lt;br /&gt;
		:addClass(message('content-div-class'))&lt;br /&gt;
		:wikitext('\n' .. (content or '') .. '\n')&lt;br /&gt;
	return tostring(cbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc('_contentTitle')&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc('_endBox')&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	--]=]&lt;br /&gt;
	&lt;br /&gt;
	-- Get environment data.&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not subjectSpace or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	-- Check whether we should output the end box at all. Add the end&lt;br /&gt;
	-- box by default if the documentation exists or if we are in the&lt;br /&gt;
	-- user, module or template namespaces.&lt;br /&gt;
	local linkBox = args['link box']&lt;br /&gt;
	if linkBox == 'off'&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the footer text field.&lt;br /&gt;
	local text = ''&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or '') -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template's sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or '')&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don't show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or '')&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
			local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.&lt;br /&gt;
			if printBlurb then&lt;br /&gt;
				text = text .. '&amp;lt;br /&amp;gt;' .. printBlurb&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ebox = mw.html.create('div')&lt;br /&gt;
	ebox&lt;br /&gt;
		:addClass(message('footer-div-class'))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
	return tostring(ebox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeDocPageBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Makes the blurb &amp;quot;This documentation is transcluded from [[Template:Foo]] (edit, history)&amp;quot;.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'transcluded-from-blurb' --&amp;gt; &lt;br /&gt;
	-- 'The above [[w:Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[w:Wikipedia:Transclusion|transcluded]] from $1.'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'create-module-doc-blurb' --&amp;gt;&lt;br /&gt;
	-- 'You might want to $1 a documentation page for this [[w:Wikipedia:Lua|Scribunto module]].'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle or args.content then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		-- /doc exists; link to it.&lt;br /&gt;
		local docLink = makeWikilink(docTitle.prefixedText)&lt;br /&gt;
		local editUrl = docTitle:fullUrl{action = 'edit'}&lt;br /&gt;
		local editDisplay = i18n['edit-link-display']&lt;br /&gt;
		local editLink = makeUrlLink(editUrl, editDisplay)&lt;br /&gt;
		local historyUrl = docTitle:fullUrl{action = 'history'}&lt;br /&gt;
		local historyDisplay = i18n['history-link-display']&lt;br /&gt;
		local historyLink = makeUrlLink(historyUrl, historyDisplay)&lt;br /&gt;
		ret = message('transcluded-from-blurb', {docLink})&lt;br /&gt;
			.. ' '&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}&lt;br /&gt;
		local createDisplay = i18n['create-link-display']&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		ret = message('create-module-doc-blurb', {createLink})&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'sandbox-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'module-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-module-sandbox'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'sandbox-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'mirror-edit-summary' --&amp;gt; 'Create sandbox version of $1'&lt;br /&gt;
	-- 'mirror-link-display' --&amp;gt; 'mirror'&lt;br /&gt;
	-- 'mirror-link-preload' --&amp;gt; 'Template:Documentation/mirror'&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display'--&amp;gt; 'edit'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'module-testcases-preload' --&amp;gt; 'Template:Documentation/preload-module-testcases'&lt;br /&gt;
	-- 'template-testcases-preload' --&amp;gt; 'Template:Documentation/preload-testcases'&lt;br /&gt;
	-- 'experiment-blurb-module' --&amp;gt; 'Editors can experiment in this module's $1 and $2 pages.'&lt;br /&gt;
	-- 'experiment-blurb-template' --&amp;gt; 'Editors can experiment in this template's $1 and $2 pages.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message('sandbox-link-display')&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}&lt;br /&gt;
		local sandboxEditDisplay = message('sandbox-edit-link-display')&lt;br /&gt;
		local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message('compare-link-display')&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message('module-sandbox-preload')&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message('template-sandbox-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message('sandbox-create-link-display')&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message('mirror-link-preload')&lt;br /&gt;
		local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		local mirrorDisplay = message('mirror-link-display')&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message('testcases-link-display')&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}&lt;br /&gt;
		local testcasesEditDisplay = message('testcases-edit-link-display')&lt;br /&gt;
		local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)&lt;br /&gt;
		testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)&lt;br /&gt;
	else&lt;br /&gt;
		local testcasesPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			testcasesPreload = message('module-testcases-preload')&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message('template-testcases-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message('testcases-create-link-display')&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = 'experiment-blurb-module'&lt;br /&gt;
	else&lt;br /&gt;
		messageName = 'experiment-blurb-template'&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'doc-link-display' --&amp;gt; '/doc'&lt;br /&gt;
	-- 'add-categories-blurb' --&amp;gt; 'Please add categories to the $1 subpage.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))&lt;br /&gt;
	return message('add-categories-blurb', {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'template-pagetype' --&amp;gt; 'template'&lt;br /&gt;
	-- 'module-pagetype' --&amp;gt; 'module'&lt;br /&gt;
	-- 'default-pagetype' --&amp;gt; 'page'&lt;br /&gt;
	-- 'subpages-link-display' --&amp;gt; 'Subpages of this $1'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('template-pagetype')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('module-pagetype')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('default-pagetype')&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',&lt;br /&gt;
		message('subpages-link-display', {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message('subpages-blurb', {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makePrintBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates the blurb displayed when there is a print version of the template available.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'print-link-display' --&amp;gt; '/Print'&lt;br /&gt;
	-- 'print-blurb' --&amp;gt; 'A [[Help:Books/for experts#Improving the book layout|print version]]'&lt;br /&gt;
	--		.. ' of this template exists at $1.'&lt;br /&gt;
	--		.. ' If you make a change to this template, please update the print version as well.'&lt;br /&gt;
	-- 'display-print-category' --&amp;gt; true&lt;br /&gt;
	-- 'print-category' --&amp;gt; 'Templates with print versions'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local printTitle = env.printTitle&lt;br /&gt;
	if not printTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if printTitle.exists then&lt;br /&gt;
		local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display'))&lt;br /&gt;
		ret = message('print-blurb', {printLink})&lt;br /&gt;
		local displayPrintCategory = message('display-print-category', nil, 'boolean')&lt;br /&gt;
		if displayPrintCategory then&lt;br /&gt;
			ret = ret .. makeCategoryLink(message('print-category'))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'display-strange-usage-category' --&amp;gt; true&lt;br /&gt;
	-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
	-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'strange-usage-category' --&amp;gt; 'Wikipedia pages with strange ((documentation)) usage'&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	local ret = ''&lt;br /&gt;
	if message('display-strange-usage-category', nil, 'boolean')&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message('doc-subpage')&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message('testcases-subpage')&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		ret = ret .. makeCategoryLink(message('strange-usage-category'))&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Module:Lua&amp;diff=559</id>
		<title>Module:Lua</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Module:Lua&amp;diff=559"/>
		<updated>2023-08-05T21:31:25Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Created page with &amp;quot;-- This module implements the {{lua}} template.  local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageBox = require('Module:Message box') local TNT = require('Module:TNT')  local p = {}  local function format(msg) 	return TNT.format('I18n/Lua banner', msg) end  local function getConfig() 	return mw.loadData('Module:Lua banner/config') end  function p.main(frame) 	local origArgs = frame:g...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements the {{lua}} template.&lt;br /&gt;
&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
local mList = require('Module:List')&lt;br /&gt;
local mTableTools = require('Module:TableTools')&lt;br /&gt;
local mMessageBox = require('Module:Message box')&lt;br /&gt;
local TNT = require('Module:TNT')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function format(msg)&lt;br /&gt;
	return TNT.format('I18n/Lua banner', msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getConfig()&lt;br /&gt;
	return mw.loadData('Module:Lua banner/config')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local origArgs = frame:getParent().args&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(origArgs) do&lt;br /&gt;
		v = v:match('^%s*(.-)%s*$')&lt;br /&gt;
		if v ~= '' then&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args, cfg)&lt;br /&gt;
	local modules = mTableTools.compressSparseArray(args)&lt;br /&gt;
	local box = p.renderBox(modules, cfg, args)&lt;br /&gt;
	local trackingCategories = p.renderTrackingCategories(args, modules, nil, cfg)&lt;br /&gt;
	return box .. trackingCategories&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderBox(modules, cfg, args)&lt;br /&gt;
	local boxArgs = {}&lt;br /&gt;
	if #modules &amp;lt; 1 then&lt;br /&gt;
		cfg = cfg or getConfig()&lt;br /&gt;
		if cfg['allow_wishes'] or yesno(args and args.wish) then&lt;br /&gt;
			boxArgs.text = format('wishtext')&lt;br /&gt;
		else&lt;br /&gt;
			boxArgs.text = string.format('&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;%s&amp;lt;/strong&amp;gt;', format('error_emptylist'))&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local moduleLinks = {}&lt;br /&gt;
		for i, module in ipairs(modules) do&lt;br /&gt;
			moduleLinks[i] = string.format('[[:%s]]', module)&lt;br /&gt;
		end&lt;br /&gt;
		local moduleList = mList.makeList('bulleted', moduleLinks)&lt;br /&gt;
		boxArgs.text = format('header') .. '\n' .. moduleList&lt;br /&gt;
	end&lt;br /&gt;
	boxArgs.type = 'notice'&lt;br /&gt;
	boxArgs.small = true&lt;br /&gt;
	boxArgs.image = string.format(&lt;br /&gt;
		'[[File:Lua-logo-nolabel.svg|30px|alt=%s|link=%s]]',&lt;br /&gt;
		format('logo_alt'),&lt;br /&gt;
		format('logo_link')&lt;br /&gt;
	)&lt;br /&gt;
	return mMessageBox.main('mbox', boxArgs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderTrackingCategories(args, modules, titleObj, cfg)&lt;br /&gt;
	if yesno(args.nocat) then&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	cfg = cfg or getConfig()&lt;br /&gt;
	&lt;br /&gt;
	local cats = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Error category&lt;br /&gt;
	if #modules &amp;lt; 1 and not (cfg['allow_wishes'] or yesno(args.wish)) and cfg['error_category'] then&lt;br /&gt;
		cats[#cats + 1] = cfg['error_category']&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Lua templates category&lt;br /&gt;
	titleObj = titleObj or mw.title.getCurrentTitle()&lt;br /&gt;
	if titleObj.namespace == 10 &lt;br /&gt;
		and not cfg['subpage_blacklist'][titleObj.subpageText]&lt;br /&gt;
	then&lt;br /&gt;
		local category = args.category&lt;br /&gt;
		if not category then&lt;br /&gt;
			local pagename = modules[1] and mw.title.new(modules[1])&lt;br /&gt;
			category = pagename and cfg['module_categories'][pagename.text]&lt;br /&gt;
			if not category then&lt;br /&gt;
				if (cfg['allow_wishes'] or yesno(args.wish)) and #modules &amp;lt; 1 then&lt;br /&gt;
					category = cfg['wish_category']&lt;br /&gt;
				else&lt;br /&gt;
					category = cfg['default_category']&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if category then&lt;br /&gt;
			cats[#cats + 1] = category&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for i, cat in ipairs(cats) do&lt;br /&gt;
		cats[i] = string.format('[[Category:%s]]', cat)&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(cats)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Template:Lua&amp;diff=558</id>
		<title>Template:Lua</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Template:Lua&amp;diff=558"/>
		<updated>2023-08-05T21:29:00Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Created page with &amp;quot;&amp;lt;onlyinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#invoke:Lua banner|main}}&amp;lt;/includeonly&amp;gt;&amp;lt;/onlyinclude&amp;gt; {{Lua|Module:Lua banner}} {{Documentation}} &amp;lt;!-- Categories go on the /doc subpage and interwikis go on Wikidata. --&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#invoke:Lua banner|main}}&amp;lt;/includeonly&amp;gt;&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
{{Lua|Module:Lua banner}}&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;!-- Categories go on the /doc subpage and interwikis go on Wikidata. --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Template:Documentation&amp;diff=557</id>
		<title>Template:Documentation</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Template:Documentation&amp;diff=557"/>
		<updated>2023-08-05T21:28:17Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; &amp;lt;languages/&amp;gt; &amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt; {{documentation|content=  {{Lua|Module:Documentation}} &amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes transcluded from another page.&amp;lt;/translate&amp;gt; &amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; It is intended for pages which are &amp;lt;tvar name=...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation|content=&lt;br /&gt;
&lt;br /&gt;
{{Lua|Module:Documentation}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes transcluded from another page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; It is intended for pages which are [[&amp;lt;tvar name=1&amp;gt;Special:MyLanguage/Help:Transclusion&amp;lt;/tvar&amp;gt;|transcluded]] in other pages, i.e. templates, whether in the template namespace or not.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Usage== &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Customizing display=== &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Overrides exist to customize the output in special cases:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;documentation{{!}}'''heading'''=&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt; - &amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; change the text of the &amp;quot;documentation&amp;quot; heading.&amp;lt;/translate&amp;gt; &amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=556</id>
		<title>Minetest.place schematic on vmanip</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=556"/>
		<updated>2023-08-05T21:26:56Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UnofficialLua}}&lt;br /&gt;
{{DISPLAYTITLE:minetest.place_schematic_on_vmanip}}&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source&amp;gt;minetest.place_schematic_on_vmanip(vm, pos, schematic, rotation, replacements, force_placement)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This method works in a similar fashion to minetest.place_schematic, but can be used with a [[VoxelManip]] for better performance when manipulating large amounts of nodes.&lt;br /&gt;
&lt;br /&gt;
* Uses VoxelManip object vm, which is the voxel manipulator you are using to e.g. generate terrain&lt;br /&gt;
* Places the schematic specified by schematic (see: Schematic specifier) at pos.&lt;br /&gt;
* Rotation can be &amp;quot;0&amp;quot;, &amp;quot;90&amp;quot;, &amp;quot;180&amp;quot;, &amp;quot;270&amp;quot;, or &amp;quot;random&amp;quot;.&lt;br /&gt;
* If the rotation parameter is omitted, the schematic is not rotated.&lt;br /&gt;
* replacements = {[&amp;quot;old_name&amp;quot;] = &amp;quot;convert_to&amp;quot;, ...}&lt;br /&gt;
* force_placement is a boolean indicating whether nodes other than air and ignore are replaced by the schematic&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|Schematics are volumes and the position where you place the schematic is the corner of the schematic. If for example you have a 5 by 5 by 5 schematic of a tree whose trunk is in the middle, you will need to offset the x and z position by -2. If you don't, you risk misplacing the tree causing them to float in the air or be generated inside blocks on e.g. steep slopes.}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The below snippet places the acacia tree from default at some terrain position with a random rotation when the data written at the voxelmanip index is dirt with dry grass. It&lt;br /&gt;
 &lt;br /&gt;
{{code&lt;br /&gt;
local data = {}&lt;br /&gt;
local vm, emin, emax = minetest.get_mapgen_object(&amp;quot;voxelmanip&amp;quot;)&lt;br /&gt;
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
-- E.g. terrain generation code here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Decoration&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		local ivm = area:index(x, minp.y-1, z)&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
			if data[ivm] == minetest.get_content_id(&amp;quot;default:dirt_with_dry_grass&amp;quot;) and math.random(0, 500) then&lt;br /&gt;
				-- We place the tree if there is grass with dirt, but we could also have retrieved the y from the&lt;br /&gt;
				-- terrain heightmap in which case we would not necessarily have to loop from minp.y to maxp.y again &lt;br /&gt;
				minetest.place_schematic_on_vmanip(vm, { x = x - 4, y = y, z = z - 4},&lt;br /&gt;
								   minetest.get_modpath(&amp;quot;default&amp;quot;)..&amp;quot;/schematics/acacia_tree.mts&amp;quot;,&lt;br /&gt;
								   &amp;quot;random&amp;quot;, nil, false)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|If you place schematics while performing the vmanip of e.g. the terrain from negative y to positive y, you may need to separate your terrain generation loop from the schematic placement loop or risk the schematics to be overwritten}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Methods|p]]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=555</id>
		<title>Minetest.place schematic on vmanip</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Minetest.place_schematic_on_vmanip&amp;diff=555"/>
		<updated>2023-08-05T21:26:13Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UnofficialLua}}&lt;br /&gt;
{{DISPLAYTITLE:minetest.place_schematic_on_vmanip}}&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source&amp;gt;minetest.place_schematic_on_vmanip(vm, pos, schematic, rotation, replacements, force_placement)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This method works in a similar fashion to minetest.place_schematic, but can be used with a [[VoxelManip]] for better performance when manipulating large amounts of nodes.&lt;br /&gt;
&lt;br /&gt;
* Uses VoxelManip object vm, which is the voxel manipulator you are using to e.g. generate terrain&lt;br /&gt;
* Places the schematic specified by schematic (see: Schematic specifier) at pos.&lt;br /&gt;
* Rotation can be &amp;quot;0&amp;quot;, &amp;quot;90&amp;quot;, &amp;quot;180&amp;quot;, &amp;quot;270&amp;quot;, or &amp;quot;random&amp;quot;.&lt;br /&gt;
* If the rotation parameter is omitted, the schematic is not rotated.&lt;br /&gt;
* replacements = {[&amp;quot;old_name&amp;quot;] = &amp;quot;convert_to&amp;quot;, ...}&lt;br /&gt;
* force_placement is a boolean indicating whether nodes other than air and ignore are replaced by the schematic&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|Schematics are volumes and the position where you place the schematic is the corner of the schematic. If for example you have a 5 by 5 by 5 schematic of a tree whose trunk is in the middle, you will need to offset the x and z position by -2. If you don't, you risk misplacing the tree causing them to float in the air or be generated inside blocks on e.g. steep slopes.}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The below snippet places the acacia tree from default at some terrain position with a random rotation when the data written at the voxelmanip index is dirt with dry grass. It &lt;br /&gt;
{{code&lt;br /&gt;
local data = {}&lt;br /&gt;
local vm, emin, emax = minetest.get_mapgen_object(&amp;quot;voxelmanip&amp;quot;)&lt;br /&gt;
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
-- E.g. terrain generation code here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Decoration&lt;br /&gt;
for z = minp.z, maxp.z do&lt;br /&gt;
	for x = minp.x, maxp.x do&lt;br /&gt;
		local ivm = area:index(x, minp.y-1, z)&lt;br /&gt;
		for y = minp.y-1, maxp.y+1 do&lt;br /&gt;
			if data[ivm] == minetest.get_content_id(&amp;quot;default:dirt_with_dry_grass&amp;quot;) and math.random(0, 500) then&lt;br /&gt;
				-- We place the tree if there is grass with dirt, but we could also have retrieved the y from the&lt;br /&gt;
				-- terrain heightmap in which case we would not necessarily have to loop from minp.y to maxp.y again &lt;br /&gt;
				minetest.place_schematic_on_vmanip(vm, { x = x - 4, y = y, z = z - 4},&lt;br /&gt;
								   minetest.get_modpath(&amp;quot;default&amp;quot;)..&amp;quot;/schematics/acacia_tree.mts&amp;quot;,&lt;br /&gt;
								   &amp;quot;random&amp;quot;, nil, false)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Template:Note|If you place schematics while performing the vmanip of e.g. the terrain from negative y to positive y, you may need to separate your terrain generation loop from the schematic placement loop or risk the schematics to be overwritten}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Methods|p]]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Template:Code&amp;diff=554</id>
		<title>Template:Code</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Template:Code&amp;diff=554"/>
		<updated>2023-08-05T21:24:48Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Created page with &amp;quot;{{#if:{{{inline|}}}|&amp;lt;code {{#if:{{{class|}}}|class=&amp;quot;{{{class}}}&amp;quot;}} {{#if:{{{id|}}}|id=&amp;quot;{{{id}}}&amp;quot;}} {{#if:{{{style|}}}|style=&amp;quot;{{{style}}}&amp;quot;}}&amp;gt;{{#tag:syntaxhighlight|{{{code|{{{1}}}}}}|lang=&amp;quot;{{{lang|{{{2|text}}}}}}&amp;quot;|inline=true}}&amp;lt;/code&amp;gt;|{{#if:{{{header|}}}|&amp;lt;u&amp;gt;&amp;lt;small&amp;gt;{{{header}}}&amp;lt;/small&amp;gt;&amp;lt;/u&amp;gt;}}{{#tag:syntaxhighlight |{{{code|{{{1}}}}}} |lang={{{lang|{{{2|bash}}}}}} }}}}&amp;lt;noinclude&amp;gt; {{documentation}} &amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#if:{{{inline|}}}|&amp;lt;code {{#if:{{{class|}}}|class=&amp;quot;{{{class}}}&amp;quot;}} {{#if:{{{id|}}}|id=&amp;quot;{{{id}}}&amp;quot;}} {{#if:{{{style|}}}|style=&amp;quot;{{{style}}}&amp;quot;}}&amp;gt;{{#tag:syntaxhighlight|{{{code|{{{1}}}}}}|lang=&amp;quot;{{{lang|{{{2|text}}}}}}&amp;quot;|inline=true}}&amp;lt;/code&amp;gt;|{{#if:{{{header|}}}|&amp;lt;u&amp;gt;&amp;lt;small&amp;gt;{{{header}}}&amp;lt;/small&amp;gt;&amp;lt;/u&amp;gt;}}{{#tag:syntaxhighlight&lt;br /&gt;
|{{{code|{{{1}}}}}}&lt;br /&gt;
|lang={{{lang|{{{2|bash}}}}}}&lt;br /&gt;
}}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=MediaWiki:Sidebar&amp;diff=553</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=MediaWiki:Sidebar&amp;diff=553"/>
		<updated>2023-08-05T05:34:01Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* keepthisline&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
* API&lt;br /&gt;
** Modding_Intro|Modding Intro&lt;br /&gt;
* Engine&lt;br /&gt;
** Engine|Engine Intro&lt;br /&gt;
** Changelog|Changelog&lt;br /&gt;
** All_rules_regarding_to_development|All dev rules&lt;br /&gt;
* links&lt;br /&gt;
** https://minetest.org/|Final Minetest&lt;br /&gt;
** https://minetest.io/|Minetest.IO&lt;br /&gt;
** https://git.minetest.io/|9,000 git repos&lt;br /&gt;
** https://edgy1.net/|EdgyNet&lt;br /&gt;
** https://irc.minetest.org:9000/#/connect|CoderNet chat&lt;br /&gt;
** https://minetest.org/bucketsrc/|Bucket Source&lt;br /&gt;
** https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents|MediaWiki help&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=552</id>
		<title>MediaWiki:Monobook.css</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=MediaWiki:Monobook.css&amp;diff=552"/>
		<updated>2023-08-05T05:26:05Z</updated>

		<summary type="html">&lt;p&gt;Poetry: Created page with &amp;quot;/* All CSS here will be loaded for users of the MonoBook skin */  .mw-wiki-logo {     background-size: contain; }  .mw-content-text, .mw-body-content {     font-size: 1.1em;     text-align: justify; }&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* All CSS here will be loaded for users of the MonoBook skin */&lt;br /&gt;
&lt;br /&gt;
.mw-wiki-logo {&lt;br /&gt;
    background-size: contain;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-content-text, .mw-body-content {&lt;br /&gt;
    font-size: 1.1em;&lt;br /&gt;
    text-align: justify;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Main_Page&amp;diff=551</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Main_Page&amp;diff=551"/>
		<updated>2023-08-05T05:15:57Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the '''Minetest Developer Wiki''', here you learn how Minetest and games and mods for Minetest are developed.&lt;br /&gt;
&lt;br /&gt;
'''Minetest''' is a [https://en.wikipedia.org/wiki/Game_engine game engine] inspired by Minecraft, Infiniminer and others. It's licensed under the GNU LGPL 2.1, with artwork generally covered by CC BY-SA 3.0. There are two major parts to the system, the first being a [[Engine structure|core engine]] written in C++, the second being a modding API that exposes useful functions to a Lua environment.&lt;br /&gt;
&lt;br /&gt;
The Minetest Wiki for players is located at [https://wiki.minetest.net/ wiki.minetest.net].&lt;br /&gt;
&lt;br /&gt;
{{Contributor Call to Action}}&lt;br /&gt;
&lt;br /&gt;
{{Main Content Links}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Root-Category]]&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Main_Page&amp;diff=550</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Main_Page&amp;diff=550"/>
		<updated>2023-08-05T05:12:28Z</updated>

		<summary type="html">&lt;p&gt;Poetry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
&lt;br /&gt;
Welcome to the '''Minetest Developer Wiki''', here you learn how Minetest and games and mods for Minetest are developed.&lt;br /&gt;
&lt;br /&gt;
'''Minetest''' is a [https://en.wikipedia.org/wiki/Game_engine game engine] inspired by Minecraft, Infiniminer and others. It's licensed under the GNU LGPL 2.1, with artwork generally covered by CC BY-SA 3.0. There are two major parts to the system, the first being a [[Engine structure|core engine]] written in C++, the second being a modding API that exposes useful functions to a Lua environment.&lt;br /&gt;
&lt;br /&gt;
The Minetest Wiki for players is located at [https://wiki.minetest.net/ wiki.minetest.net].&lt;br /&gt;
&lt;br /&gt;
{{Contributor Call to Action}}&lt;br /&gt;
&lt;br /&gt;
{{Main Content Links}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Root-Category]]&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Poetry</name></author>
	</entry>
</feed>