贡献者/项目/参考分栏

This page is a translated version of the page Contributors/Projects/Columns for references and the translation is 55% complete.
Outdated translations are marked like this.

受维基百科编者要求,MediaWiki加入了一个新功能。 Long lists of references (created with ‎<ref> tags; they are also called citations or footnotes at some wikis) will automatically be displayed in columns. 所分栏数取决于读者各自的屏幕宽度。 This will improve 無障礙 and make it easier for most people to read the references, especially on narrow or very wide screens. Short lists of references will not be affected.

如果您所处的维基(Wiki)已启用此功能,使用一般的‎<references />即可看到其效果。如果您想禁用此功能,可以使用<references responsive="0" />代替之前的代码。

计划

服务器端的软件配置将于2017年3月14日一周的部署火车到站期间完成。 However, the effect will not normally be visible (except on MediaWiki.org where it is responsive by default[1]) until it is manually enabled for your particular wiki. WMF-hosted wikis that want this feature working locally can request a config change to enable it.

如要在软件配置完成之后、功能尚未启用之前体验功能,可以通过手动使用<references responsive />代码替代一般的‎<references />标签或参考列表模板达成。

组:

  • Wikiquotes: Monday, 24 July 2017

与本地模板的关系

有些维基百科人一直都在使用{{Reflist}}等本地模板创建分栏等特殊格式。 These templates should be updated (or their use deprecated as redundant) before this change is manually enabled at your local wiki.

如何更新本地模板

如果您希望改进无障碍环境

考虑将本功能对于‎<references />默认的「动态分栏」模式定为模板的默认行为,同时弃用或删除硬性定义分栏数目的几个参数。

如果您希望不对模板当前行为做任何更改

<references responsive />会将生成的列表自动包裹入<div class="mw-references-wrap">元素内。 在功能默认启用时,任何超过10条参考的参考列表也会获得mw-references-columnsCSS类(class)属性。 In this mode, the references list is automatically split over multiple columns based on the available space on the screen. E.g. on narrow screens 1 or 2 columns, on wider screens 2 or 3. Given that this happens automatically, it is no longer necessary for editors to manually enable/disable the columns mode of a template.

其他对于参考列表的自定义操作最好应加在MediaWiki:Common.css中的ol.references选择器下。 Many wikis customise the font-size this way, for example. (No need to manually code it through a template). In case a DIV wrapper is needed for certain styles, the .mw-references-wrap CSS selector will apply to all references lists produced by <references responsive /> regardless of whether the columns were dynamically activated.

为了保证与固定列数的分栏模式相兼容,您应保证相关的(reflist、refhead)模板在检测到手动参数时会使用responsive=0关闭自动分栏。如果你担心有人会手动替换reflist,还可以手动编辑MediaWiki:Common.css,令相关分栏规则的CSS选择器只处理上一级不为.mw-references-wrapol.references元素。这一点可以通过使用CSS的“直接子元素运算符”>实现。 You may also want edit relevant layout rules in your wiki's MediaWiki:Common.css to only match ol.references elements without a wrapping .mw-references-wrap parent in order to avoid repeated definitions of multi-column layout. This can be done in the CSS using e.g. a direct descendant > operator.

请求该功能

要请求该功能在您本地维基启用,填写这张预格式化的任务表单提交Phabricator任务即可。

或者在讨论页留言。 Please include a link to any local discussions or relevant templates in your requests.

参考资料