打开主菜单

维基百科:整理討論

整理討論(重構,英语:Refactoring)是改善討論結構的步驟,頁面內容可能被移動、刪除、修改、重組、隱藏、或其他方式改變。其僅適用於有編者簽署語句(如用戶頁或對話頁)的內文,包括下列各種用法:

  • 改善頁面的清晰度和可讀性
  • 去除離題、不文明、含糊、或其他分散注意力的材料
  • 重組討論使條理清晰
  • 將材料易位至其他更合適的章節或頁面

重構應當視為一項工具,從「飛快的」討論中分離不需要的雜質,而不等待整個討論正式歸檔。用語「重構」來自電腦運算的代碼重構,代碼重組(以改善品質)而不改變程式運作。

良好施行重構對維護有成效的討論頁面至關重要。雜亂、仇敵、過於複雜、結構不良、或交叉談論造成擁塞的討論頁面,會使潛在貢獻者喪氣和產生誤會侵蝕了討論的成果。

重構應當僅由討論頁面的參與者基於誠信執行。若討論頁最近沸沸揚揚,整理可能缺乏誠信。如果其他編者反對,應該還原重構的變化。不過若該頁面超過了建議大小,無需重構仍然可以完成存檔該討論頁或近期沒有發言的章節。

目录

概述编辑

在早期的維基百科歷史,尤其在2006年以前,討論頁的內容會替換為總結以節省空間──此為一種非完全保存的重構方法。然而,社群開始偏好將討論頁內的討論內容整體存檔,因為存檔可以保存更完整的討論,不會導致其他編輯者意見的錯誤表達(無論是純屬意外或故意混亂),並保留未來可能有用的素材。同樣的原則也開始更廣泛地使用在重構上。

依據規則,編輯者應避免影響其他編輯者所要表達的意義,而不應編輯其他編輯者的留言──doing so creates misrepresentations, disrupts the flow of conversations, and makes debates and discussions impossible to follow – but cases exist in which an editor's comments need to be removed from the flow of conversation because the comments themselves disrupt the flow of conversation. Loosely, the following types of refactoring are legitimate, with the listed caveats:

Non-contentious cleanup – anything where you are sure that the other editor will thank you for the effort, rather than getting angry.

  • Adding missing topic headings and attribution
  • Correcting indentation levels
  • Fixing technical matters of wikitext formatting, tables, templates, and the like
  • Other minor fixes (correcting other user's spelling or grammar is discouraged, but fixing obvious typos is generally acceptable)
  • Reattaching signatures that have been split from the text, or attaching missing signature templates such as {{Unsigned}} where users have forgotten to sign

Restructuring – should be done with care to avoid changing meanings.

  • Adding new sections that split an editor's comment into separate points
  • Moving a comment to a more appropriate place in the discussion
  • Moving or copying a comment to begin a new discussion in a different section

Pruning text – should only be done with the original author's consent, or with good cause under policy.

  • Removing, striking or hiding personal attacks
  • Hiding redundant, outdated, or otherwise superfluous material from view
  • Relocation of text to different pages where it is more appropriate

如何重構编辑

依據維基百科的討論頁指引,鼓勵編輯者移除任何認定為不適當的內容。A link to the talk page history should be added if the removed text was part of discussions by other editors. See WP:Diff for guidance on creating a link to the page history and WP:Talk page guidelines#Behavior that is unacceptable for guidance on inappropriate talk page content.

在這裡有數種可用於重構的工具與技術:

刪除
編輯並將文字完全刪除。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:

參見编辑

外部連結编辑