Skip to content

Support displaying only areas of diff #6

@leosunmo

Description

@leosunmo

First of all, great library! This is a tricky problem to solve and it's done very nicely in jsondiff!

Now, I am diffing very large JSON files, and I would like to only output the actual differences, not the entire doc if possible.

I couldn't see an existing way to do this, but if there is, please let me know!

Either a config setting that would allow you to display X lines/objects above and below each diff, or potentially a way to roll up previous fields?

The roll-up would ideally look something like this:
From online demo:

{
    "content": [
        {
            "align": "center",
            "content": [
                {
                    "content": "And please, feel free to send us your feedback and comments to ",
                    "style": {
                        "bold": 2,
                        "color": "FFFFFF",
                      - "fontFamily": "Arial",
                        "italic": 2,
                      + "name": "Arial",
                        "size": 20,
                      ~ "underline": 1 => 2
                    }
                },
...

Rolled up:

{
    "content": [
        {
            "content": [
                {
                    "style": {
                        "bold": 2,
                        "color": "FFFFFF",
                      - "fontFamily": "Arial",
                        "italic": 2,
                      + "name": "Arial",
                        "size": 20,
                      ~ "underline": 1 => 2
                    }
                },
...

Or potentially by separating parent objects using a dot notation:

content.content.style {
                        "bold": 2,
                        "color": "FFFFFF",
                      - "fontFamily": "Arial",
                        "italic": 2,
                      + "name": "Arial",
                        "size": 20,
                      ~ "underline": 1 => 2
                    }

It's a tricky one, but to start with, just having an option to say, only display X lines above and below the change, might be enough!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions