本模块主要用於require('Module:Module wikitext')._addText
(Module:Module wikitext)中,用於客製化模組命名空間。
使用方法為複製以下代碼到要客製化的模組中:
如果上述設置仍無法防止模板循環,即模組或調用模組的頁面出現以下錯誤:
可考慮改用以下代碼:
上述文档嵌入自Module:Special wikitext/Custom Module/doc。 (编辑 | 历史) 编者可以在本模块的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 本模块的子页面。 |
#include <string>
#include "Module:Special_wikitext/Custom_Module/tools.h"
#include "Module:Special wikitext/Custom Module.h"
std::string main () {
std::string wikitext = new mw::title("Template:Special wikitext/Custom Module")->getContent();
wikitext = removeNoinclude(wikitext);
mw::frame *frame = mw::getCurrentFrame();
wikitext = frame->preprocess(wikitext);
wikitext = removeIndicator(wikitext);
return wikitext;
}
本模块主要用於require('Module:Module wikitext')._addText
(Module:Module wikitext)中,用於客製化模組命名空間。
使用方法為複製以下代碼到要客製化的模組中:
如果上述設置仍無法防止模板循環,即模組或調用模組的頁面出現以下錯誤:
可考慮改用以下代碼:
上述文档嵌入自Module:Special wikitext/Custom Module/doc。 (编辑 | 历史) 编者可以在本模块的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 本模块的子页面。 |
local p = {}
require('Module:Module wikitext')._addText([[((#ifexpr:(({is_in_doc|0))}=0|((Special wikitext/Hide Code))((Special wikitext/Hide Doc))<div class="special-wikitext-not-hide">
((#invoke:Special_wikitext/Custom_Module/tools|removeIndicator|((#invoke:documentation|main|is_in_doc=((#expr:(({is_in_doc|0))}+1))|_content=(( ((#invoke:documentation|contentTitle))))))))
<syntaxhighlight lang=cpp line>
#include <string>
#include "Module:Special_wikitext/Custom_Module/tools.h"
#include "Module:Special wikitext/Custom Module.h"
std::string main () {
std::string wikitext = new mw::title("Template:Special wikitext/Custom Module")->getContent();
wikitext = removeNoinclude(wikitext);
mw::frame *frame = mw::getCurrentFrame();
wikitext = frame->preprocess(wikitext);
wikitext = removeIndicator(wikitext);
return wikitext;
}</syntaxhighlight></div>((AnyLink|Category:使用自訂模組頁面的模組|Special wikitext/Custom Module))))]])
function p.main()
local tools = require("Module:Special_wikitext/Custom_Module/tools")
local wikitext = mw.title.new("Template:Special wikitext/Custom Module"):getContent()
wikitext = tools.removeNoinclude(wikitext)
local frame = mw.getCurrentFrame()
wikitext = frame:preprocess(wikitext)
wikitext = tools.removeIndicator(wikitext)
return wikitext
end
return p