Added slice remapper and improved documentation (#8)

* Experimental slice remapper
* Added iter_slices to DiffOp
* Improvements to the utility diff functions
* Documentation improvements
* More documentation updates on utils
* More documentation on main text diff
This commit is contained in:
Armin Ronacher 2021-02-06 21:41:49 +01:00 committed by GitHub
parent 81ef0b1adc
commit 777105fbb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 668 additions and 16 deletions

View file

@ -10,6 +10,8 @@
//! It provides both low level access to the algorithms with the minimal
//! trait bounds necessary, as well as a generic interface.
//! * [`udiff`]: Unified diff functionality.
//! * [`utils`]: utilities for common diff related operations. This module
//! provides additional diffing functions for working with text diffs.
//!
//! # Sequence Diffing
//!
@ -41,15 +43,13 @@
//! "Hallo Welt\nThis is the second line.\nThis is life.\nMoar and more",
//! );
//!
//! for op in diff.ops() {
//! for change in diff.iter_changes(op) {
//! let sign = match change.tag() {
//! ChangeTag::Delete => "-",
//! ChangeTag::Insert => "+",
//! ChangeTag::Equal => " ",
//! };
//! print!("{}{}", sign, change);
//! }
//! for change in diff.iter_all_changes() {
//! let sign = match change.tag() {
//! ChangeTag::Delete => "-",
//! ChangeTag::Insert => "+",
//! ChangeTag::Equal => " ",
//! };
//! print!("{}{}", sign, change);
//! }
//! # }
//! ```
@ -129,6 +129,8 @@
pub mod algorithms;
#[cfg(feature = "text")]
pub mod udiff;
#[cfg(feature = "text")]
pub mod utils;
mod common;
#[cfg(feature = "text")]