<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://130.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ADocumentation</id>
	<title>Module:Documentation - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://130.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ADocumentation"/>
	<link rel="alternate" type="text/html" href="https://130.wiki/index.php?title=Module:Documentation&amp;action=history"/>
	<updated>2026-10-12T06:25:28Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://130.wiki/index.php?title=Module:Documentation&amp;diff=3410&amp;oldid=prev</id>
		<title>闲敲棋子落灯花：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://130.wiki/index.php?title=Module:Documentation&amp;diff=3410&amp;oldid=prev"/>
		<updated>2026-08-03T09:32:04Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年8月3日 (一) 09:32的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key 130.wiki::diff:1.41:old-3409:rev-3410 --&gt;
&lt;/table&gt;</summary>
		<author><name>闲敲棋子落灯花</name></author>
	</entry>
	<entry>
		<id>https://130.wiki/index.php?title=Module:Documentation&amp;diff=3409&amp;oldid=prev</id>
		<title>Qiuwen&gt;海屿有燕：​切换为站点字体默认色</title>
		<link rel="alternate" type="text/html" href="https://130.wiki/index.php?title=Module:Documentation&amp;diff=3409&amp;oldid=prev"/>
		<updated>2025-10-08T09:40:15Z</updated>

		<summary type="html">&lt;p&gt;切换为站点字体默认色&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- 本模块是从维基百科的相关模块简化的。&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local getArgs = require &amp;#039;Module:Arguments&amp;#039;.getArgs&lt;br /&gt;
require &amp;#039;strict&amp;#039;&lt;br /&gt;
&lt;br /&gt;
function p._main(args, f)&lt;br /&gt;
  -- args是不含元表的表&lt;br /&gt;
  -- f是框架，应该作为第二个参数传入&lt;br /&gt;
  f = f or mw.getCurrentFrame()&lt;br /&gt;
  args = args or {}&lt;br /&gt;
  &lt;br /&gt;
  local content = args.content&lt;br /&gt;
  -- 关于标题对象的处理&lt;br /&gt;
  local title=args.page and mw.title.new(args.page)&lt;br /&gt;
              or mw.title.getCurrentTitle()&lt;br /&gt;
  local T=tostring(title)&lt;br /&gt;
  &lt;br /&gt;
  local doctitle=args[1] and mw.title.new(args[1])&lt;br /&gt;
               or mw.title.new(T..&amp;quot;/doc&amp;quot;)&lt;br /&gt;
  local D=tostring(doctitle)&lt;br /&gt;
  local sandboxtitle=mw.title.new(T..&amp;quot;/sandbox&amp;quot;)&lt;br /&gt;
  local S=tostring(sandboxtitle)&lt;br /&gt;
  local testcasestitle=mw.title.new(T..&amp;quot;/testcases&amp;quot;)&lt;br /&gt;
  local E=tostring(testcasestitle)&lt;br /&gt;
  local document, doc_exists&lt;br /&gt;
  local fullurl = require &amp;#039;模块:fullurl&amp;#039;._fullurl&lt;br /&gt;
  local pageName = require &amp;#039;模块:page name&amp;#039;.pageName(T)&lt;br /&gt;
  local env = p.getEnvironment(args)&lt;br /&gt;
  &lt;br /&gt;
  if content then&lt;br /&gt;
    document = content&lt;br /&gt;
  else&lt;br /&gt;
    --先获取文档内容&lt;br /&gt;
    local doc_exists = doctitle.exists&lt;br /&gt;
    local state -- boolean&lt;br /&gt;
    if not doc_exists then&lt;br /&gt;
      document=(&amp;#039;本%s还没有文档页面。&amp;#039;)&lt;br /&gt;
          :format(pageName)&lt;br /&gt;
    else&lt;br /&gt;
      state, document = pcall(function() &lt;br /&gt;
        return f:expandTemplate{title=doctitle,args={isdoc=1}} &lt;br /&gt;
      end)&lt;br /&gt;
      if not state then&lt;br /&gt;
        document=&amp;#039;尝试调用文档内容时发生未知错误：&amp;#039;..document&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  local autogen = {}&lt;br /&gt;
  if title and title.namespace==828 then&lt;br /&gt;
    do&lt;br /&gt;
  		-- 尝试获取页面内容并识别重定向。&lt;br /&gt;
  		local successes, page_content = pcall(title.getContent, title)&lt;br /&gt;
  		if successes then&lt;br /&gt;
  			local target = nil  -- 模块可能重定向至的页面名称。&lt;br /&gt;
  			local match = page_content:match &amp;#039;%s*return%s+require%s*(.+)%;*%s*&amp;#039;&lt;br /&gt;
  			if match then&lt;br /&gt;
  				match = match:match &amp;#039;^%s*%((.-)%)%s*$&amp;#039; or match&lt;br /&gt;
  				target = match:match &amp;#039;^%s*&amp;quot;(.-)&amp;quot;%s*$&amp;#039; or match:match &amp;quot;^%s*&amp;#039;(.-)&amp;#039;%s*$&amp;quot;&lt;br /&gt;
  					or match:match &amp;quot;^%s*%[%[(.-)%]%]%s$&amp;quot;&lt;br /&gt;
  			end&lt;br /&gt;
  			if target then&lt;br /&gt;
  				autogen[#autogen + 1] = &amp;quot;本模块是一个重定向模块，重定向至[[&amp;quot; .. target .. &amp;quot;]]。&amp;quot;&lt;br /&gt;
  			end&lt;br /&gt;
  		else&lt;br /&gt;
  			mw.log(&amp;quot;[Module:Documentation] 尝试获取页面内容时出现错误：&amp;quot; .. page_content)&lt;br /&gt;
  		end&lt;br /&gt;
  	end&lt;br /&gt;
    if title.isSubpage and title.rootText == &amp;#039;CGroup&amp;#039; then&lt;br /&gt;
      local CGroupViewer = require(&amp;#039;Module:CGroupViewer&amp;#039;)&lt;br /&gt;
    	autogen[#autogen + 1] = [=[&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
以下内容根据模块内容通过[[Module:CGroupViewer]]模块生成，仅供参考。&lt;br /&gt;
&lt;br /&gt;
]=] .. CGroupViewer.main(f:newChild({args = {title.subpageText}}))&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  local contents = {&lt;br /&gt;
    photo=&amp;quot;[[File:Information Mark (Blue).svg |24px|link=|alt=文档图示]] &amp;#039;&amp;#039;&amp;#039;&amp;quot;..pageName --不同名字空间显示不同名字&lt;br /&gt;
          ..&amp;quot;-{zh-hans:文档;zh-hant:文件}-&amp;#039;&amp;#039;&amp;#039;&amp;quot;,&lt;br /&gt;
    edit=string.format(&amp;quot;&amp;amp;#91;[[Special:EditPage/%s|编辑]]&amp;amp;#93;&amp;quot;,D), -- 编辑按钮&lt;br /&gt;
    hist=string.format(&amp;quot;&amp;amp;#91;[[Special:PageHistory/%s|查看历史]]&amp;amp;#93;&amp;quot;,D), -- 查看历史按钮&lt;br /&gt;
    purge=string.format(&amp;quot;&amp;amp;#91;[[Special:Purge/%s|清除-{zh-hans:缓存;zh-hant:快取}-]]&amp;amp;#93;&amp;quot;,T), -- 清除缓存按钮&lt;br /&gt;
    goto_code = &amp;#039;&amp;amp;#91;[[#to-code|跳转到代码]]&amp;amp;#93;&amp;#039;,&lt;br /&gt;
    set=string.format(&amp;#039;您可以%s文档以让用户更好地理解本%s的用途。&amp;#039;, fullurl{title=D,action=&amp;#039;edit&amp;#039;,text=&amp;#039;创建&amp;#039;,redlink=&amp;#039;1&amp;#039;}, pageName),&lt;br /&gt;
    context=(&amp;#039;上述文档内容由%s本身直接提供，请查看页面源代码。&amp;#039;):format(pageName),&lt;br /&gt;
    invtext=string.format(&amp;#039;编者可以在本%s的沙盒&amp;lt;small&amp;gt;（%s）&amp;lt;/small&amp;gt;和测试样例&amp;lt;small&amp;gt;（%s）&amp;lt;/small&amp;gt;页面进行实验。&amp;lt;br&amp;gt;&amp;#039;,pageName,&lt;br /&gt;
          sandboxtitle.exists and string.format(&amp;quot;[[Special:EditPage/%s|编辑]]&amp;quot;,S) or fullurl{title=S,action=&amp;#039;edit&amp;#039;,redlink=&amp;#039;1&amp;#039;,text=&amp;#039;创建&amp;#039;} .. &amp;#039; &amp;amp;#124; &amp;#039; .. fullurl{title=S,action=&amp;#039;edit&amp;#039;,preload=T,text=&amp;#039;镜像&amp;#039;}, --“沙盒”后括号内的文字&lt;br /&gt;
          testcasestitle.exists and string.format(&amp;quot;[[Special:EditPage/%s|编辑]]&amp;quot;,E) or fullurl{title=E,action=&amp;#039;edit&amp;#039;,redlink=&amp;#039;1&amp;#039;,text=&amp;#039;创建&amp;#039;}&lt;br /&gt;
        )&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  local root=mw.html.create()&lt;br /&gt;
		:wikitext(p._getModuleWikitext(args, env))&lt;br /&gt;
&lt;br /&gt;
  local css = {[&amp;#039;clear&amp;#039;]= &amp;#039;both&amp;#039;;&lt;br /&gt;
	    [&amp;#039;border&amp;#039;]= &amp;#039;1px solid #a2a9b1&amp;#039;; &lt;br /&gt;
	    [&amp;#039;background-color&amp;#039;]= &amp;#039;#ecfcf4&amp;#039;; &lt;br /&gt;
	    [&amp;#039;padding&amp;#039;]= &amp;#039;5px&amp;#039;;&lt;br /&gt;
	    [&amp;#039;color&amp;#039;]= &amp;#039;#01113e&amp;#039;;&lt;br /&gt;
  }&lt;br /&gt;
  local editsectionlike = content and &lt;br /&gt;
            {contents.purge}&lt;br /&gt;
            or doctitle.exists and&lt;br /&gt;
            {&lt;br /&gt;
            string.format(&amp;quot;&amp;amp;#91;[[%s|-{zh-cn:查看;zh-tw:檢視}-]]&amp;amp;#93;&amp;quot;,D), -- 查看按钮&lt;br /&gt;
            contents.edit,&lt;br /&gt;
            contents.hist,&lt;br /&gt;
            contents.purge&lt;br /&gt;
            }&lt;br /&gt;
            or {&lt;br /&gt;
            string.format(&amp;quot;&amp;amp;#91;%s]&amp;quot;, &lt;br /&gt;
            fullurl{title=D,action=&amp;#039;edit&amp;#039;,redlink=&amp;#039;1&amp;#039;,text=&amp;#039;创建&amp;#039;}&lt;br /&gt;
            )}&lt;br /&gt;
  if title.namespace == 828 then&lt;br /&gt;
    editsectionlike[#editsectionlike + 1] = contents.goto_code end&lt;br /&gt;
  root&lt;br /&gt;
    :tag&amp;#039;div&amp;#039;&lt;br /&gt;
      :addClass&amp;#039;template-documentation iezoomfix&amp;#039;&lt;br /&gt;
      :css(&amp;#039;margin&amp;#039;, &amp;#039;1em 0&amp;#039;)&lt;br /&gt;
      :newline()&lt;br /&gt;
      :tag&amp;quot;div&amp;quot;&lt;br /&gt;
        :addClass &amp;#039;template-documentation-header&amp;#039;&lt;br /&gt;
        :css(&amp;#039;margin-bottom&amp;#039;, &amp;#039;0.2em&amp;#039;)&lt;br /&gt;
        :css(css)&lt;br /&gt;
        :tag&amp;quot;span&amp;quot; --“模板文档”以及前的图片&lt;br /&gt;
          :css{&lt;br /&gt;
            [&amp;#039;font-size&amp;#039;]=&amp;#039;110%&amp;#039;,&lt;br /&gt;
          }&lt;br /&gt;
          :wikitext(contents.photo)&lt;br /&gt;
        :done()&lt;br /&gt;
        :tag&amp;quot;span&amp;quot; --其后的编辑等按钮&lt;br /&gt;
          :addClass&amp;quot;mw-editsection-like&amp;quot;&lt;br /&gt;
          :wikitext(table.concat(editsectionlike, &amp;#039; &amp;#039;)) -- “:wikitext”的参数结束&lt;br /&gt;
        :done()&lt;br /&gt;
      :done()&lt;br /&gt;
      :newline()&lt;br /&gt;
      :tag &amp;#039;div&amp;#039;&lt;br /&gt;
        :addClass &amp;#039;template-documentation-body mw-parser-output&amp;#039;&lt;br /&gt;
        :css(css)&lt;br /&gt;
        :wikitext(string.sub(document,1,1)~=&amp;#039;\n&amp;#039; and &amp;#039;\n&amp;#039; or nil)&lt;br /&gt;
        :wikitext(document)&lt;br /&gt;
        :wikitext(table.concat(autogen)) -- 自动生成的部分，可能为nil&lt;br /&gt;
        :wikitext(string.sub(document,-1,-1)~=&amp;#039;\n&amp;#039; and &amp;#039;\n&amp;#039; or nil)&lt;br /&gt;
        :tag &amp;#039;div&amp;#039;&lt;br /&gt;
          :css(&amp;#039;clear&amp;#039;, &amp;#039;both&amp;#039;)&lt;br /&gt;
          :done()&lt;br /&gt;
      :done()&lt;br /&gt;
      :tag&amp;quot;div&amp;quot;&lt;br /&gt;
        :addClass&amp;quot;template-documentation-foot&amp;quot;&lt;br /&gt;
        :css(css)&lt;br /&gt;
        :css{&lt;br /&gt;
        	padding = &amp;#039;0.25em 0.9em&amp;#039;;&lt;br /&gt;
			[&amp;#039;margin-top&amp;#039;] = &amp;#039;0.2em&amp;#039;;&lt;br /&gt;
		}&lt;br /&gt;
        :wikitext(&lt;br /&gt;
          content and contents.context&lt;br /&gt;
          or doctitle.exists and string.format(&lt;br /&gt;
            &amp;#039;上述文档内容嵌入自[[%s]]。&amp;lt;small style=&amp;quot;font-style:normal&amp;quot;&amp;gt;（[[Special:EditPage/%s|编辑]] &amp;amp;#124; [[Special:PageHistory/%s|历史]]）&amp;lt;/small&amp;gt;&amp;#039;,&lt;br /&gt;
          D,&lt;br /&gt;
          D,&lt;br /&gt;
          D)&lt;br /&gt;
          or contents.set&lt;br /&gt;
        )&lt;br /&gt;
        :wikitext(#autogen &amp;gt; 0 and &amp;#039;部分内容为自动生成。&amp;#039; or nil)&lt;br /&gt;
        :wikitext &amp;#039;&amp;lt;br&amp;gt;&amp;#039;&lt;br /&gt;
        :wikitext(contents.invtext)&lt;br /&gt;
        :wikitext((&amp;#039;请将%s自身所属的分类添加在文档中。[[Special:前缀索引/%s/|本%s的子页面]]。&amp;#039;):format(pageName, T, pageName))&lt;br /&gt;
  if title.namespace == 828 then&lt;br /&gt;
    root:tag &amp;#039;div&amp;#039;&lt;br /&gt;
        :attr(&amp;#039;id&amp;#039;, &amp;#039;to-code&amp;#039;) end&lt;br /&gt;
  return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&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&amp;#039;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&amp;#039;t call any of the functions&lt;br /&gt;
	-- more than once. (Nils won&amp;#039;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;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&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(&amp;#039;sandbox-subpage&amp;#039;) or subpage == message(&amp;#039;testcases-subpage&amp;#039;) 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;
		-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&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 .. &amp;#039;/&amp;#039; .. message(&amp;#039;doc-subpage&amp;#039;)&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;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;sandbox-subpage&amp;#039;))&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;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;testcases-subpage&amp;#039;))&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;
		-- &amp;#039;print-subpage&amp;#039; --&amp;gt; &amp;#039;Print&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message(&amp;#039;print-subpage&amp;#039;))&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 .. &amp;#039;:&amp;#039; .. 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;
				&amp;#039;Special:ComparePages&amp;#039;,&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;
-- 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) == &amp;#039;string&amp;#039; then&lt;br /&gt;
					value = value:match(&amp;#039;^%s*(.-)%s*$&amp;#039;) -- Remove whitespace.&lt;br /&gt;
					if key == &amp;#039;heading&amp;#039; or value ~= &amp;#039;&amp;#039; 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;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc(&amp;#039;_getModuleWikitext&amp;#039;)&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 ~= &amp;#039;Scribunto&amp;#039; then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don&amp;#039;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;
	return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == &amp;#039;testcases&amp;#039; then&lt;br /&gt;
		return frame:expandTemplate{title = &amp;#039;module test cases notice&amp;#039;}&lt;br /&gt;
	else&lt;br /&gt;
		return p.main(frame)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
  local args=getArgs(frame)&lt;br /&gt;
  return p._main(args, frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Qiuwen&gt;海屿有燕</name></author>
	</entry>
</feed>