WMDE Technical Wishes/Sub-referencing/zh
子引用 | |
---|---|
Status | 进行中 |
Origin | 技术愿望调查2013,2015,2022和其他。 |
Focus area | 使得再次引用更容易 |
Phabricator | 项目告示板 |
Responsible | 技术愿望團隊 |
![]() 告诉我们您的想法 我们邀请您测试我们持續不断更新的原型。請观看本页面或是注册本消息列表以了解可供您测试的新内容 |
在目前,你無法在同一篇文章中輕易地再次使用同一個不同细节的参考资料。社群成员們已多次要求一种无需模板的解决方案,且该解决方案是基于维基文本和可视化编辑器的现有引用方式。 » 了解关于该问题的更多内容
作为"使得再次引用更容易"这一重点领域的一部份,德国维基媒体的技术愿望团队正在引入子引用--这是一项可选功能,让您可以轻松地在现有参考资料上依附不同细节的內容,而无需复制它。
Our plan is to bring Sub-referencing to the Wikimedia wikis in 2025.
子引用的简要介绍
要多次引用同一来源并附上不同的细节,您需要一个主引用和一个子引用。
- 主引用包含主要的书目信息。
- 子引用包含细节信息:页码或每次引用时不同的附加信息,例如章节、段落或注释。
- A sub-reference defines additional details, such as page numbers, chapters, verses, quotes, or video timestamps. In the screenshot, "1.1" and "1.2" followed by a page number represent two different sub-references.

- 在参考资料區中,读者可以看到所有子参考资料都分组在它们的主参考资料之下。这便于读者理解单个来源在该文章中被引用的频率。
In wikitext you use a new attribute to define the details of a sub-reference. It’s called details
. See below for more information and examples.
在可视化编辑器中,我们正在更改现有的引用对话框,使其支持子引用。
主要益处
- Sub-referencing is largely based on the existing way references work.
- It's designed to work for both Visual Editor and wikitext.
- 该解决方案将集成到 MediaWiki 中,因此可在所有维基媒体维基中使用,而且无需基于模板。
- 子引用可在参考资料预览中正确显示,并且预览框在移动裝置也可以正常弹出。
- 此為可选项:您仍然可以使用其他方法进行引用。 但您可能会在其他用户撰写的文章中遇到子引用。

工作原理
在维基文本中使用
具体优势
- 该解决方案基于已知的命名引用概念。
- 不需要任何模板知识。
- 可以删除维基文本中近似重复的引用,使其更简洁、减少冗余文字、并更易于阅读。
How to use Sub-referencing in wikitext
1) Define a Main Reference
Before creating sub-references, you need a main reference that contains the full bibliographic information. This reference must be assigned a name:
<ref name="Miller">E. Miller, ''The Sun''. New York: Academic Press, 2005.</ref>
This main reference can either be defined in-line (within the article text) or in the reference section.
2) Creating a Sub-reference for Inline References
If the main reference is inline, you can create a sub-reference in two ways using the details
attribute:
Option 1: Modify the main reference to include additional details (e.g. a page number)
<!-- Add the details attribute directly to the <ref> tag -->
<ref name="Miller" details="Page 23.">E. Miller, ''The Sun''. New York: Academic Press, 2005.</ref>
<!-- As a next step, you can add another sub-reference using the following statement: -->
<ref name="Miller" details="Page 48." />
Example Usage:

According to scientists, the Sun is pretty big. In fact, it is very big.<ref name="Miller" details="Page 23.">E. Miller, ''The Sun''. New York: Academic Press, 2005.</ref> Take their word for it.<ref name="Miller" details="Page 48." />
== References ==
{{reflist}} <!-- or <references /> -->
Option 2: Insert one or more separate sub-references directly within a new in-line statement while keeping the main reference intact.
<!-- Unchanged main reference (in-line): -->
<ref name="Miller">E. Miller, ''The Sun''. New York: Academic Press, 2005.</ref>
<!-- New sub-references: -->
<ref name="Miller" details="Page 23." />
<ref name="Miller" details="Page 48." />
Example Usage:

According to scientists, the Sun is pretty big. <ref name="Miller">E. Miller, ''The Sun''. New York: Academic Press, 2005.</ref> In fact, it is very big.<ref name="Miller" details="Page 23." /> Take their word for it.<ref name="Miller" details="Page 48." />.
== References ==
{{reflist}} <!-- or <references /> -->
3) Create Sub-References for List-Defined References
If the main reference is stored in the <references>
tag or within {{reflist}}
(or similar templates), you don't need to redefine it in-line. Instead, simply use the following syntax in-line:
<!-- Add this directly to the chosen location in the article text -->
<ref name="Miller" details="Page 23." />
<!-- The list-defined reference stays unchanged: -->
<references>
<ref name="Miller">E. Miller, ''The Sun''. New York: Academic Press, 2005.</ref>
</references>
Example Usage:

According to scientists, the Sun is pretty big. In fact, it is very big.<ref name="Miller" details="Page 23." /> Take their word for it.<ref name="Miller" details="Page 48." />
== References ==
<references>
<ref name="Miller">E. Miller, ''The Sun''. New York: Academic Press, 2005.</ref>
</references>
4) Reusing an Existing Sub-reference
Once a sub-reference has been defined, you can reuse it in multiple places without redefining the main reference. Simply repeat the same reference syntax in-line:
<ref name="Miller" details="Page 23." />
- Please note that while this is not a pure reuse like you are used to with main references and does create duplicates in wikitext, in the reader and Visual Editor view, identical statements will be merged to prevent unnecessary duplication in the rendered output. This is still work in progress.
- The same re-use statement applies for list-defined and inline main references.
- Tip: Copying and pasting an existing sub-reference statement remains a simple and recommended approach.
Example Usage for Reuse of Inline References:

According to scientists, the Sun is pretty big.<ref name="Miller" details="Page 23.">E. Miller, ''The Sun''. New York: Academic Press, 2005</ref> In fact, it is very big. Take their word for it.<ref name="Miller" details="Page 48." /> Don't look directly at the sun!<ref name="Miller" details="Page 23." />
== References ==
{{reflist}}
Example Usage for Reuse of List-defined References:

According to scientists, the Sun is pretty big.<ref name="Miller" details="Page 23." /> In fact, it is very big. Take their word for it.<ref name="Miller" details="Page 48." /> Don't look directly at the sun!<ref name="Miller" details="Page 23." />
== References ==
<references>
<ref name="Miller">E. Miller, ''The Sun''. New York: Academic Press, 2005</ref>
</references>
Keep In Mind

- Remember to always specify a reference name when using the details attribute. Using a reference name allows others to easily re-use the same reference with different details without needing to define a name first.
- Sub-referencing is not reserved for page numbers only. You can use it for other use cases, too. Some editors have mentioned to us that they’d like to use it for podcast timestamps, URLs, poetry verses, quotes, and other details.
- If you wish to use quotation marks
"
withindetails="…"
(e.g. when inserting a quote), make sure to use"
instead, or delimit the details with single quotes. Visual Editor users will be able to type " when filling out sub-reference details and it will be converted automatically in wikitext. Other special characters which might need to be handled similarly when used withdetails="…"
are<
and>
. - Some gadgets/scripts related to references might also need an update in order to properly work with the new sub-referencing solution.
- When using sub-references, please avoid templates that produce
<ref>
tags, as these cause issues in Visual Editor which we cannot solve at this point in time.
在可视化编辑器中(开发中)
We are actively refining the user experience and workflows for Sub-referencing in Visual Editor. Currently, there is one entry point via the “re-use” tab for creating a sub-reference, but the solution for Visual Editor is expected to evolve in the coming months.
You can also test the prototype with the current state of the Visual Editor solution. Please keep in mind that it will likely change. As always, we will keep you and these project pages updated as Visual Editor gains more capabilities and let you know when we need your feedback!
可视化编辑特有的优势
- 若要引用同一资料来源的不同细节,您不必再从头开始创建新的引用。
- 子引用与可视化编辑器完全兼容(而非基于模板的变通方法): 您可以通过引文对话框创建子引用,也可以在参考资料部分编辑子引用。
当前测试版本的操作流程(仍可能会有改动)
创建子引用
- 目前可通过现有的引用对话框创建子引用。
- 在“再次引用”选项卡中,通过三個点选择要再次使用的参考,然后点击“再次引用此参考并提供更多详细信息”。
- 输入子引用的详细信息,然后单击插入。
- 在可视化编辑器中,引用的弹出窗口会显示该参考资料是一个子引用,并显示其被重复使用的次数。
编辑现有的子引用
再次引用一个子引用
请注意
- 可视化编辑器中引用自动命名的现有问题也会出现在子引用中。
- We are actively working on creating an even more intuitive user experience for Visual Editor. What you see now is just the beginning, it will be refined and improved over time.
- 我们尚未处理删除一个被重复使用的引用时会发生的情况。
- Currently, if you re-use a sub-reference it will show as a duplicate in the reference list. Once the Visual Editor's UX has evolved, the duplicates will automatically be merged in Visual Editor and the reader view.
測試我們的原型
我们需要你的反馈来确保正确的功能构建。任何反馈或问题都可以在该项目的讨论页面上提出。
原型已在beta维基上提供。目前,我们主要邀请用户测试维基文本中的解决方案:

- 外观可能不同(例如没有使用您设置的皮肤)。
- 也可能会提供一些仍在测试中的新功能。
- beta维基只包含一些测试页面和模板,而不是整个维基百科的内容,也没有你习惯使用的所有模板、模块、小工具等。
- 您无法使用您普通维基的账户。您可以注册一个账户,确保和普通维基账户的密码不同,或者在没有账户的情况下测试该功能。这将会创建一个临时账户(在德语beta维基上),或者显示你的IP地址(在英语beta维基上)。
我们正在解决的问题
在维基百科文章中,通常会多次引用同一个来源。但虽然你可以直接重复使用相同的引用,但目前无法在引用不同细节(例如不同页码)的情况下重复使用同一个引用。你只能选择创建一个新的引用或使用其他方法。
现状:在维基文本和可视化编辑器中再次引用参考资料
如果想在维基文本中重复使用参考资料,可以将其转化为命名参考资料,并在文章的另一处引用该名称。命名参考资料可以放在文章文本中,也可以放在参考资料部分。在可视化编辑器中,您可以使用引用对话框中的 “再次引用”选项。在参考资料部分,具有相同名称的参考资料会被组合在一起。
-
维基文本: 文本中的<ref name>
-
维基文本:参考资料部分中的<ref name>
-
可视化编辑器: 引用对话框
-
读者看到的效果
现状: 在维基文本中重复使用具有不同细节的参考资料
如果想在维基文本中重复使用细节不同的现有参考资料,目前需要复制并粘贴现有参考资料,然后更改重复内容的细节,或者从头开始创建一个几乎相同的新参考资料。有些项目使用简短引用或簡略脚注等基于模板的解决方案。在参考资料部分,原始参考资料和您创建的新参考资料不会放在一起。
-
维基文本中有两处几乎相同的引用。
-
读者视角:几乎相同的参考资料没有放在一起
-
维基文本中短引文的变通方法
-
读者视角:使用短引文的变通方法
-
在维基文本中使用{{sfn}}的变通方法
-
读者视角:在维基文本中使用{{sfn}}的变通方法
现状: 在可视化编辑器中重复使用具有不同细节的引用
如果您想在可视化编辑器中以不同的细节重新使用已有的参考资料,引文对话框中的“复用”选项和复制粘贴都不会起作用,因为这两种方法都会导致完全相同的重新使用,而更改重新使用或复制的参考资料的细节会改变该参考资料的全部。相反,你需要从头开始创建一个几乎相同的新引用。在“引用”部分,原始引用和您创建新的引用不会被组合在一起。
通过{{sfn}}等基于模板的变通方法创建的参考资料无法在参考资料部分进行编辑,也不会出现在引文重用选项卡中;但可以在文章文本中查找这些参考资料时对其进行手动编辑。
使用{{sfn}}的变通方法:
-
读者看到的效果
-
参考资料会在点击“编辑”后,从参考资料區消失。
-
你无法通过“再次引用”对话框來使用{{sfn}}引用。
-
只有在文章中找到参考资料时才能编辑参考资料
读者遇到的问题
在参考资料预览、参考资料提示工具和手机软件的参考弹出窗口中无法正确显示基于模板的变通方法。
带有引用预览的{{sfn}}解决办法:
现状的主要问题
- Visual Editor和wikitext用户的使用体验截然不同。
- 大多数再次引用不同细节的引用的变通方法在Visual Editor中都无法正常工作。
- 创建大量具有不同细节的几乎完全相同的引用,会使维基文本更长,而且可能更难阅读。
- 基于模板的变通方法并不为所有社区所接受,因此无法在全域范围内使用。
- 有些用户为了避免这个问题,会把资料来源放在参考书目部分,而根本不把它们作为参考资料,这就增加了验证文章部分的难度。
最近的变更和下一步计划
我们的团队断断续续地研究这个问题已经有一段时间了。这里是这个项目的历史概述,包括我们的研究。
感谢所有参加过测试和访谈、对我们感兴趣的人,以及多年来花时间在我们的谈话页面上发表评论的人。我们对此深表感谢。如果您有更多反馈意见,请在讨论页上与我们分享。
Thank you to everyone who participated in tests and interviews and who showed interest, as well as everyone who took the time to comment on our talk pages over the years. It is deeply appreciated. If you have further feedback, please share it on the talk page.
Updates March 2025
In 2024 we worked on a prototype for discovery and testing purposes based on the extends syntax and engaged with the community through multiple on-wiki communications, user testing sessions, and workshops in different venues, including Wikimania 2024.
In October/November 2024, we explored possible changes to our wikitext approach, based on the community feedback we've received. We reached out to communities and presented a new solution to get their feedback on its usability. We found that the feedback was mixed but nothing spoke against the feature bringing its intended value to the community.
In 2025, we started the development of the new syntax. The engineers and designer of the Technical Wishes team are working on building out Sub-referencing.
Next Steps
The Technical Wishes team’s focus remains on completing the sub-referencing feature.
- We’ll update you continuously as the feature evolves on the betawiki and we need you to test it.
- Conducting user testing sessions with community members to help us with intuitively designing the Visual Editor workflows.
- Once the development has reached a stable state, we will reach out to Pilot wikis to plan deployments.
- We are planning to deploy the sub-referencing feature to other Wikimedia wikis in 2025.
- We will continue to collect feedback to improve the solution after deployment.
我们意识到了重点领域“再次使用引用”中的其他问题,我们将努力解决这些问题。不过,我们的重点仍然是为子引用创建一个解决方案。
Archived updates from 2024
测试版维基上有一个原型。它涵盖有wikitext的解决方案和 Visual Editor解决方案的一些基本功能。您可以继续测试此原型并提供反馈。
我们已在所有维基中发出通知,让社群了解这一即将推出的功能,并邀请他们进行测试和提供反馈。
我们的团队在2024國際維基媒體大会上介绍了子引用,并与与会者进行了讨论。 (YouTube)
Moderated users tests took place across different projects in 2024.
- As of October/November 2024, we are currently exploring possible changes to our wikitext approach, based on the community feedback we've received. We'll reach out to communities soon to get more feedback on possible changes to the Sub-referencing feature.
- Pilot wiki deployment is stalled, pending discussions and potential changes to our feature.
- We are planning to deploy the Sub-referencing feature to other Wikimedia wikis in 2025.
- 我們將在功能安裝後持續收集用戶的回饋。
常见问题
如何查找使用子引用的文章?
A tracking category called Category:Pages that use sub-references is added to any page where Sub-referencing is used, allowing you to explore or fix pages using the new feature. The name of this category might change.
Also, the team has created a number of examples on the English betawiki.
Can I insert a template into the details
attribute?
The feedback we received so far from the community suggests that using templates in an attribute may cause more issues than benefits. As such, we are evaluating whether to allow templates based on technical feasibility, their impact on Visual Editor’s rendering of references, and other concerns raised by contributors.
We will update you once we have learned more and a decision has been made. Please know that we will always include the community before such a decision is made. If you already have specific ideas about the use of templates within the details attribute, please let us know on our talk page.
How will the new feature affect existing gadgets and scripts?
Some gadgets and scripts related to references might need an update in order to properly work with the new Sub-referencing solution. Because gadgets and scripts are in the hands of the wiki communities, we are unable to adapt them.
Please let us know, on the talk page, if you discover any problems or need some help updating citation templates to make them work with the new feature.
为什么选择这种维基文本语法?
This post provides a rationale for choosing the details
syntax. We believe that the best and quickest path to delivering a usable feature is through the chosen syntax, even though it does come with some limitations.
Historically, no syntax has been perfect, and each solution has its shortcomings. After long discussions and consultations with multiple teams at the Wikimedia Foundation, we've concluded that this solution meets our technical requirements and is sustainable for long-term maintenance.
It's also fully compatible with wikis that continue to rely on or prefer using {{reflist}}
. This syntax allows the main reference to be used in-line without needing to be placed in the References section, which would otherwise cause limitations in the Visual Editor.
Furthermore, we’re confident that this approach will work consistently across Visual Editor workflows as well.
为什么找到解决方案花了这么长时间?
技术愿望团队在这个功能上断断续续工作了很多年。如果你想了解更多信息,请参阅问题的历史和复杂性概览。