维基百科:整理讨论
![]() | 本页为操作指南,用于介绍中文维基百科社群的一些实现和操作方式。 本文只是论述,不属于方针或指引。如果本指南与方针或指引起冲突或不一致,请以方针或指引的条文为准。 |
整理讨论(重构,英语:Refactoring)是改善讨论结构的步骤,页面内容可能被移动、删除、修改、重组、隐藏或其他方式,但仅适用于有编者签署语句(如用户页或对话页)的地方。整理讨论有以下作用:
- 改善页面的清晰度和可读性
- 去除离题、不文明、含糊、或其他分散注意力的材料
- 重组讨论使条理清晰
- 将材料易位至其他更合适的章节或页面
比起编修,重构更加简要概括,但不像存档那样能够反映完整的事实。重构能够像编修一样保留作者的原意和目的,但可能像存档一样涉及删除当时曾经存在的文字。重构应当视为一项工具,从“飞快的”讨论中分离不需要的杂质,而不等待整个讨论正式归档。
用语“重构”来自电脑运算的代码重构,代码重组(以改善品质)而不改变程式运作。
良好施行重构对维护有成效的讨论页面至关重要。杂乱、仇敌、过于复杂、结构不良、或交叉谈论造成拥塞的讨论页面,会使潜在贡献者丧气和产生误会侵蚀了讨论的成果。
重构应当仅由讨论页面的参与者基于假定善意执行。若讨论页最近正在激烈地讨论,突然进行重构可能缺乏善意。如果其他编者反对,应该还原重构所造成的变化。不过若该页面超过了建议大小,无需重构仍然可以存档该讨论页或近期没有发言的章节。
概述
编辑在过去的维基百科,尤其在2006年以前,讨论页的内容会替换为简要总结来节省空间──这是一种会丢失原文的重构方法。然而,后来社群开始将讨论页内的讨论内容整体存档,因为存档可以保存更完整的讨论,不会导致其他编者的意见被错误表达(无论是纯属意外或故意扰乱),并保留未来可能有用的资料。同样的原则也开始更广泛地使用在重构上。
依据规则,编辑者应避免影响其他编辑者所要表达的意义,而不应编辑其他编辑者的留言──这么做可能会导致陈述被歪曲,会话被打断,并且影响其他用户跟进讨论。但一些情形下编辑者的发言需要被移除,因为其发言本身扰乱了会话。一般而言,下列情形整理讨论是没有问题的:
非争议性清理——在任何您能确定其他编者会感谢,而不会感到不快的情况,例如:
- 补上遗漏的标题和标示
- 按照维基格式更正段落缩进
- 修复死链
- 修复例如维基文本格式、表格、模板等技术问题
- 改进标题,使其具有总结性
- 修复错误的签名位置(如文本和签名分离),以及为未签名的文本挂上{{Unsigned}}
- 其他的小修改(不建议更正其他用户的语法错误,但是更正明显的错字还是可以接受的)
改变讨论结构——请注意不能改变讨论原意:
- 根据不同的议题,把文字分成几个章节
- 把文字放到更合适的位置
- 把一段文字移动或复制到不同的章节,针对这一章节发起更集中的讨论
删减会话——只有取得原作者同意,或者依照方针有合理的理由才可以这么做:
- 删除、划掉、或者隐藏人身攻击
- 隐藏多余的、过时的、或者其他不必要内容
- 将会话迁移到更适合存放的页面
如何重构
编辑依据维基百科的讨论页指引,鼓励编辑者移除任何认定为不适当的内容。只有在移除的会话在其他编辑者的会话中有所提及的情况下,才应该添加指向讨论页历史的链接。关于创建指向会话页历史链接,参见Help:差异;关于不合宜的会话内容,参见Wikipedia:讨论页指引。
在这里有数种可用于重构的工具与技术:
- 删除
- 编辑并将文字完全删除。Except for non-contentious fixes, this should only be done by the editor who wrote the material or by a sysop or bureaucrat with legitimate cause. Unless a sysop uses Oversight, RevDel, or a page has been deleted entirely, the deleted text will still appear in old revisions of the page.
- 划线
- 使用HTML的划线语法─“
<s>被劃線文字</s>
”会产生“被划线文字”。此段文字仍将会在其页面中读取,也会显示在页面搜寻当中。 - Moving text off-page
- Material can be userfied or moved to a different page where it is more appropriate. If the refactoring is later reverted, the moved material should be deleted on the pages it was moved to prevent proliferation of the text.
- Hidden divs, collapsible tables, and templates
- A number of tools and templates hide or block text from further editing – {{hidden}}, {{cot}}, {{hat}}, {{archive top}}, {{discussion top}}. These work by creating collapsible tables or hidden divs. Material collapsed in this fashion does not show up in page searches unless it is in an expanded state.
The tool or technique used should be chosen according to the particular needs of the material.
The creation of an FAQ is recommended for any points that are likely to be repeatedly raised and refactored. Existing material should be generalized appropriately and reformatted into a simple question/answer format so that later editors can have their concerns satisfied without raising the question again. Likewise, lengthy ongoing discussions might benefit from template refactoring with a summary. The {{quote box}} template can be used to provide a floating summary box next to a refactored discussion, or a comment may be added at the bottom (or sometimes the top) of a section.
截除
编辑In some cases, discussion should be broken down into new sections or subsections. This is useful when a section becomes overly long, or when conversation begins to diverge into a number of separate points. Resectioning may help both readers and participants understand the flow of the discussion and help them find relevant parts of the text.
For long discussions, participants often insert arbitrary breaks by adding a new subsection heading. In fact, such breaks are often given headings like 'Arbitrary break' or 'convenience break', with an index number to distinguish it from other arbitrary break headings. Discussions that cover multiple points or become more complex, by contrast, may benefit from the creation of subsections to address different points, or in extreme cases by splitting off sections of text into entirely new sections. It may be necessary in these cases to reorganize large swatches of text, and if so care should be taken to ensure that no comments are taken out of context or lose connection with the original point they were addressing. It may be advisable to copy sections of text rather than move them (adding a comment that refers back to the original text), to duplicate the original author's signature across different points that have been moved to different sections, or to begin the new section with a parenthetical statement explaining the original context of the comment.
请参考下面的范例。
考量
编辑在进行重构时,应注意以下考量:
- Refactoring may cause confusion if improperly applied to an ongoing discussion; an editor should take great care to preserve all such discussion and all relevant details to its context.
- Editors should be conscious of the newcomer's perspective; one should not remove content that would benefit an editor who had not yet read the page.
Be aware that not every editor will agree with your refactoring or even of the refactoring concept in general. Provide links to the original, uncut version, so others can check your changes, and if necessary go back to the original to clarify what an author actually said. This combination of refactoring and archiving will often prevent complaints that information was lost. Make it explicit that you have refactored something so no one is misled into thinking this was the original talk page.
If you think people may object to their discussion being refactored, make your summary on a different page. Rather than reducing archives 7 to 10 of Talk:New Imperialism, create a new page entitled [[Talk:New Imperialism/Summary of archives 7 to 10]]. Link this to the top of the appropriate archives, and to the current talk page. This gives newcomers the chance to get a quick understanding without the risk of losing what has gone before. Having a linked archive can help satisfy both those who feel their words must remain intact and those who want a neat summary.
进阶工具
编辑Simple refactoring can easily be done with standard Wikipedia browser editing, but if you are faced with a particularly complex or tedious refactoring job, an advanced text editor or any of an assortment of scripting languages can be immensely helpful. Basically, any tool that has extended find and replace features, regular expression capabilities, or programmatic text processing will become your best friend. Alphabetizing material, sorting sections into chronological order, changing multiple links, restructuring large tables – these tasks can be painful and time consuming to do by hand, but can be accomplished in a matter of minutes programmatically. Most high-end 'Office'-type have advanced text editing capabilities, and many light-weight but powerful text editing applications are available – see list of text editors. Many scripting languages for text processing also exist; common ones are Perl, Python, Unix shell scripting, and AppleScript.
For long refactoring jobs, it may help to tag the page(s) being refactored with Template:Refactoring. Simply add {{refactoring}}
to the top of the page(s). This will alert other editors to the fact that the pages are under construction, and should help minimize edit conflicts.
明显范例
编辑Talk pages or talk page sections that have benefited from refactoring:
- Mother Teresa
- Exterior to what? Ausdehnungslehre means "extension theory", not "exterior theory" (conservative refactoring by inserting paragraph titles)
- Is there a convention about the order of multivector components? (conservative refactoring by inserting subheadings and paragraph titles)