Skip to content

Add support for configuring padding surrounding items in flow collections #419

@cemerick

Description

@cemerick

I am looking to meet some user expectations/preferences in how flow collections are rendered in YAML that we generate. Specifically, I'd like to avoid the single-space padding that is currently hard-coded around flow collection items:

str = `${start} ${lines.join(' ')} ${end}`

Would you be open to adding a node-level formatting option (much like spaceBefore, etc) to control the size of this padding?

(FWIW, I've looked at using CSTs, but the prospect of building up documents using them vs. the much simpler AST is daunting. Note that these documents are being generated, not parsed from some existing source and modified; if that were the case, then using the CST facilities would be a snap. I can imagine a stringify approach that first distilled an AST to some default CST tree, which one could then modify as desired, but ofc that's not how things are set up. 😄 )

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