如何显示修订历史记录,例如修订 [英] How to show revision history like revisions

查看:119
本文介绍了如何显示修订历史记录,例如修订的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Stack Overflow如何以他们使用的类似diff格式显示修订版本更改?

How does Stack Overflow show the revision changes in the diff-like format they use?

我本身并不关心Stack Overflow;这只是描述我的要求的便捷方式。我有一个文本字段更改的审核历史记录。我想以堆栈溢出显示修订历史记录更改的方式显示更改。我记得在Jeff Atwood讨论过的Stack Overflow播客中,但是我在笔录中找不到它,也不知道是什么播客。 IIRC,它不是基于.NET的,也许不是Python吗?

I don't care about Stack Overflow per se; it's just a convenient way to describe my requirement. I have an audit history of changes to a text field. I'd like to show the changes the same way Stack Overflow shows revision history changes. I recall a Stack Overflow podcast where Jeff Atwood discussed it, but I can't find it in the transcripts and have no idea what podcast. IIRC, it's not .NET based, maybe Python?

这是供最终用户使用的,因此任何看起来像Unix差异的东西都不存在。试图显示两个块和新旧文本并让他们找出来是很诱人的,但是StackOverflow的修订历史记录要好得多。

This is for end-user consumption so anything that looks like a Unix-like diff is out. It is tempting to show two blocks and text, old and new and let them figure it out, but the Stack Overflow revision history is sooo much nicer.

推荐答案

由于您并未真正指定语言,因此,我使用PHP PEAR包文本差异

Since you didn't really specify a language: I've done this using the PHP PEAR package Text_Diff.

这篇关于如何显示修订历史记录,例如修订的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆