パッケージ com.kazurayam.difflib.text


package com.kazurayam.difflib.text

This module extends the capability of the java-diff-utils library.

Sample usage

 package com.kazurayam.sample;

 import com.kazurayam.difflib.text.Differ;
 import com.kazurayam.difflib.text.DiffInfo;
 import com.kazurayam.difflib.text.DiffInfoReporter;

 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;

 public class App {
     public static void main(String[] args) throws Exception {
         Path original = Paths.get("./src/test/fixtures/text1.txt");
         Path revised = Paths.get("./src/test/fixtures/text2.txt");
         Path output = Paths.get("./build/temp/report.md");
         Files.createDirectories(output.getParent());

         DiffInfo diffInfo = Differ.diffFiles(original, revised);
         diffInfo.setTitle("Sample diff report of 2 text files");
         MarkdownReporter reporter = new MarkdownReporter.Builder(diffInfo).build();
         Files.writeString(output, reporter.compileMarkdownReport());
         System.out.println(reporter.compileStats());
     }
 }
導入されたバージョン:
0.1.0
  • クラス
    クラス
    説明
    Compare 2 texts to create a report which shows the diff of the 2 inputs.
    The Data object for a Diff report.
     
    A pointer to a DiffRow entry in a List of DiffRows.
    A segment of consective sequence of @see com.kazurayam.difflib.text.DiffRowDescriptor objects
    Sample code to demonstrate how to use the @see com.kazurayam.difflib.text.Differ and the related classes
    Compiles a Diff report in Markdown format
     
    Implements helper methods called by @see com.kazurayam.difflib.text.MarkdownReporter