差异对比
描述 | 并排显示两段文本,并高亮显示二者之间的差异。 |
|---|---|
类型 | 块级 - 独占一行 |
并排显示两段文本,并高亮显示二者之间的差异。
当读者需要准确看到哪些内容发生了变化时,就可以使用它:例如新旧配置块、两个版本的政策措辞,或重构前后的代码片段。无需再阅读两个版本并用肉眼逐一比对。
您将两个版本分别粘贴到宏的“之前”和“之后”文本框中,宏会在两个窗格中显示它们,并标记出新增和删除的内容。它比较的是您提供的文本,因此不能用来比较 Confluence 页面版本或附件。两个窗格对读者均为只读,因此任何人都无法直接修改比较内容。


#查看效果
下面的两个示例都是本页面上的实时 Diff 宏,而不是截图,并且每个示例使用的都是他人实际构建的页面中的配置。在编辑器中打开此页面,即可查看它们各自的设置方式。
#一段文字的两个版本
Agile development is a process that emphasizes iterative work sequences. These work sequences are known as sprints, and they are used to improve the development workflow. Agile is ideal for teams looking to adapt quickly to changes and ensure customer satisfaction.
Agile development is a project management process focusing on iterative work cycles, often called sprints. These cycles help streamline the workflow and enhance team efficiency. Agile is an excellent approach for teams aiming to rapidly adapt to changes while maintaining a high level of customer satisfaction.
#整理前后的代码片段
def calculate_area(radius):
pi = 3.14
area = pi * radius * radius
print("The area is", area)
return areadef calculate_area(radius):
import math
area = math.pi * radius ** 2
return area#设置
设置 | 取值 | 它会更改什么 |
|---|---|---|
之前 | 任意多行文本 | 原始版本,显示在左侧窗格中。 |
之后 | 任意多行文本 | 修改后的版本,显示在右侧窗格中,并标出与“之前”版本的差异。 |

#相关内容
小巧,却暗藏实用。
