“模板:Documentation/doc”与“MediaWiki:Mainpage.js”:页面之间的差异

爱来自星云工艺喵!(づ。◕◡◡◕。)づ
< 模板:Documentation(页面间差异)
(创建页面,内容为“<!--此模板还在汉化中--> {{Documentation}} '''documentation'''模板是在template/module文档中转录的。这个模板应该只用在标题中带有"doc"的模板。 ==用法== 将{{t|documentation}}放在文档页面的顶部。 If the page to be documented is a subpage, use {{t|documentation|pagename of page to be documented}} at the top of the documentation page. For example, Template:Foo/bar's documentation page would use {{t|documentation|Te…”)
 
无编辑摘要
 
第1行: 第1行:
<!--此模板还在汉化中-->
$(function(){
 
    /* 头图 */
{{Documentation}}
    var page = document.querySelector("body");
'''documentation'''模板是在template/module文档中转录的。这个模板应该只用在标题中带有"doc"的模板。
    if (page.classList.contains('page-首页')) {
 
        var mwBody = document.getElementById('content');
==用法==
        var newDiv = document.createElement('div');
将{{t|documentation}}放在文档页面的顶部。
        newDiv.setAttribute('class', 'header-image');
 
        newDiv.innerHTML = '<div class="header-image" style="background-image: linear-gradient(to top, var(--color-surface-0), transparent 50%), url(https://wiki.knebulae.com/images/title.png);background-size: cover;background-position: top;height: 36vh;margin-bottom: -37vh;"></div>';
If the page to be documented is a subpage, use {{t|documentation|pagename of page to be documented}} at the top of the documentation page. For example, Template:Foo/bar's documentation page would use {{t|documentation|Template:Foo/bar}}.
        mwBody.parentNode.insertBefore(newDiv, mwBody);
 
    }
The template will attempt to auto detect and link <code><nowiki>{{#Invoke:}}</nowiki></code> calls on template documentations or the <code>require()</code>/<code>mw.loadData()</code> depedency list on module documentations. If you want to supress the auto generated dependency list, use {{t|documentation|DependencyList=no}}
}());
 
==提示==
这个模板链接到一个/doc,可能看起来毫无用处,然而,它的存在是为了将导航框和用户框链接到其基础模板的文档。
 
<includeonly></includeonly>
 
==TemplateData==
<templatedata>
{
"params": {},
"description": "The documentation template is transcluded in the template/module documentation. This template should only be used on subpages titled \"doc\"."
}
</templatedata>

2024年1月3日 (三) 16:23的版本

$(function(){
    /* 头图 */
    var page = document.querySelector("body");
    if (page.classList.contains('page-首页')) {
        var mwBody = document.getElementById('content');
        var newDiv = document.createElement('div');
        newDiv.setAttribute('class', 'header-image');
        newDiv.innerHTML = '<div class="header-image" style="background-image: linear-gradient(to top, var(--color-surface-0), transparent 50%), url(https://wiki.knebulae.com/images/title.png);background-size: cover;background-position: top;height: 36vh;margin-bottom: -37vh;"></div>';
        mwBody.parentNode.insertBefore(newDiv, mwBody);
    }
}());