Let the apologists have a field day in the comments.

  • paequ2@lemmy.today
    link
    fedilink
    English
    arrow-up
    20
    ·
    edit-2
    13 days ago

    Yeah, I’ve definitely grown to like TOML, especially after spending hours trying to edit a giant (nested) YAML file…

    I didn’t realize the indentation in TOML was purely aesthetic.

    This

    [servers]
      [servers.alpha]
      ip = "10.0.0.1"
      dc = "eqdc10"
    
      [servers.beta]
      ip = "10.0.0.2"
      dc = "eqdc10"
    

    equals this

    [servers]
    [servers.alpha]
    ip = "10.0.0.1"
    dc = "eqdc10"
    
    [servers.beta]
    ip = "10.0.0.2"
    dc = "eqdc10"
    

    which equals this

    {
      "servers": {
        "alpha": {
          "ip": "10.0.0.1",
          "dc": "eqdc10"
        },
        "beta": {
          "ip": "10.0.0.2",
          "dc": "eqdc10"
        }
      }
    }
    
    • Fushuan [he/him]@lemm.ee
      link
      fedilink
      English
      arrow-up
      5
      ·
      13 days ago

      Once the file is big enough wouldn’t it be better to convert it to json before editing, then converting it back?

      Let the computer deal with indents and all that stuff.

      • paequ2@lemmy.today
        link
        fedilink
        English
        arrow-up
        1
        ·
        13 days ago

        Because … well … wait, not a bad idea. Although, this would get rid of comments. Which in my case, I didn’t have too many, so I could have manually added them back.