close
Jump to content

Ajuda: Diff

From mediawiki.org
This page is a translated version of the page Help:Diff and the translation is 52% complete.
Outdated translations are marked like this.

Uma diff (abreviação de diferença) exibe as alterações entre duas revisões de uma página. As diferenças são um componente fundamental da navegação e moderação de conteúdos nas wikis do MediaWiki.

As plataformas do ecossistema da wiki têm várias versões de uma diferença dependendo de que dispositivo e instalação do MediaWiki está a ser utilizado.

Quando e por que utilizar uma diferença?

O motivo principal para utilizar uma diferença é para rever uma alteração específica de uma página criada por si ou por outra pessoa. Há muitas razões possíveis para o fazer:

  • Para ajudar a encontrar casos de vandalismo
  • To determine when a section, sentence, or word was added or removed
  • To determine which editor made a given change
  • As a starting point to further actions as the diff contains editar, desfazer, and other actions as well as links to the editor's user and talk pages.

Como navegar para ver uma diff?

The most common way to view a diff is through the "Revision history". This is accessible via the Ver histórico tab. From there, you can use ant to view diffs of single revisions, or use the radio buttons and the Comparar as versões selecionadas button to view diffs across multiple revisions.

Most special pages that list changes will usually include links to diffs, such as:

Another way to view a diff is with the Special:Diff page. To use this, you must know the IDs of the revisions you want to compare. Revision IDs can be retrieved by looking at the diff=123 portion of a diff URL, where 123 is the diff ID. Additionally, you can use the value of the oldid parameter to get the diff of that revision against the previous one.

Componentes para uma diff

Below is a visual representation of the important components of a diff page which you will see when viewing the difference between two versions.

BERJAYA
Componentes de uma diff


This interactive example shows the top of the diff page (some of the links are dummy links). The older revision is shown on the left, the newer revision on the right.

(Edit summaries in diffs are great)
m (correction, + MediaWiki User's Guide)
 
Linha 8: Linha 8:
  For sysops and those with the rollback flag, a revert button is shown allowing them to revert from the new version to the old one.   For sysops and those with the rollback flag, a revert button is shown allowing them to revert from the new version to the old one.
This is only shown when viewing the diff between the current version and the one immediately preceding it. + This is only shown when viewing the diff between the recent version of a page and the last version by an author other than the one of the most current version.
  This example shows the top of the diff page, with the links described above.   This example shows the top of the diff page, with the links described above.
Linha 25: Linha 25:
  </table>   </table>
+ [[MediaWiki User's Guide]]
+

Texto Inalterado

O texto inalterado está em cinzento escuro sobre cinzento claro (são mostradas apenas as partes antes e depois do texto alterado).

Significado das cores
Diff anterior Nova diff
Inalterado Inalterado

Texto movido

Identical text that has moved from one place to another is usually represented as added and removed text. On MediaWiki installations using Wikidiff2 , there may be an arrow icon more clearly indicating where the moved text went to.

Texto adicionado

Lines containing added text have a plus icon (+) before them. The added words and characters are highlighted and in bold.

Texto removido

Lines containing removed text have a minus icon () before them. The removed words and characters are highlighted and in bold.

Texto substituído

We can see what has been replaced with new content when there's a + icon and a − icon next to the phrase where the change happened.

Paragraphs which have changed are black on white, with an orange border on the old revision side and a blue border on the new version side.

Inserted and removed text is highlighted with the border color and in bold. Where whole paragraphs have been removed or inserted, no highlighting or bolding is applied and the other side is blank.

Significado das cores
Revisão antiga Nova revisão
Parágrafo alterado Parágrafo alterado
Significado das cores
Revisão antiga Nova revisão
Parágrafo removido  
  Parágrafo adicionado
Significado das cores
Revisão antiga Nova revisão
Carateres removidos Carateres adicionados

Interligar para uma diff

As Diffs podem ser interligadas copiando o URL enquanto visualiza a diferença - este URL tem dois parâmetros, diff e oldid.

Linking to a diff from outside a wiki can be done by using the full URL, for example:

  • https://mediawiki.org/w/index.php?diff=1242287

The diff special page at Special:Diff makes it easier to create shorter URLs which redirect to diffs.

From within a wiki, these links can take the following forms:

These links may be used in the edit summary as well as being adapted like any other internal links, e.g. [[Special:Diff/1242286/1242287|see this diff]]see this diff.

For example, the full URL [https://mediawiki.org/w/index.php?diff=1242287 1242287] could also be written as [[Special:Diff/1242287|1242287]].

By default, the later revision of the page is displayed in full below the diff — this can be turned off via a preference (Não mostrar o conteúdo da página abaixo das diferenças) or by setting diffonly=1 in the URL. Links to diffs without the page text can be created:

Diferenças em linha

Versão MediaWiki:
1.35

Desde o MediaWiki 1.35, está disponível uma diferença em linha (também conhecida como diff unificada). A partir de 2022, isto só está disponível com o mecanismo wikidiff2 . Pode-se aceder às diferenças em linha passando o parâmetro diff-type=inline no URL (exemplo).

Versão MediaWiki:
1.41

A partir do MediaWiki 1.41, adicionou-se um botão de alternar às páginas diff que permite aos utilizadores mudarem entre em linha e duas colunas na interface do utilizador ($1). T336716

Content added Content deleted
(Edit summaries in diffs are great)
m (correction, + MediaWiki User's Guide)
 

For sysops and those with the rollback flag, a revert button is shown allowing them to revert from the new version to the old one.

This is only shown when viewing the diff between the current version and the one of a page and the last version by an author other than the one of the most current version.. This example shows the top of the diff page, with the links described above.

</table>

[[MediaWiki User's Guide]]

↲ newline

The following changes were introduced for inline diff:

  • Legends and tooltips that explain the blue and yellow highlights. (T324759)
  • Annotation that represent when one or more lines are added or deleted. (T330247)

Como reportar erros=

Os erros deverão ser reportados no Phabricator sob a etiqueta #MediaWiki-Page-diffs.

Preferências do Utilizador

The following user preferences are available in the Diferenças section of the Aspeto preferences tab:

Não mostrar o conteúdo da página abaixo das diferenças
Toggle the display of the page text below the diff. This text is the later of the two revisions of the page.
Não mostrar diferenças depois de reverter edições em bloco
Whether to show the diff of the rolled back revision after a rollback.

Some extensions also add their own preferences related to diffs. One such extension is Extension:RevisionSlider , which can be disabled in preferences using the Não mostrar a barra de revisões preference in that section.


Consultar também