Skip to content

Preserve original formatting when serializing #26

@henrikje

Description

@henrikje

Hi Anton! 👋🙂

In my current use case, I have a user-edited toml file where I sometimes want to update a specific value programmatically. In this scenario, I would want to update the file without losing any comments or custom white space added by the user (except when directly affected by the change).

In the the most general form, TomlValue.from(path).write(path) would be a "no-op". If the TomlValue is modified between reading and writing as little formatting should change as possible. As a more special case, I could imagine a special operation which writes a new value to a single specified key without decoding the full document. But that may not be in line with the current API.

I understand that this may be a fundamental change and simply out of scope, but it doesn't hurt to ask, right? 😁

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