-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for configuring padding surrounding items in flow collections #419
Comments
Sure, the internal padding for single-line flow collections could be made configurable. I think it's more of a ToString Option though? As in, I don't see the need to have this be configurable on a per-node basis, rather than as an overall rule to use for all collections. |
Oh sure, that will work, too. Will have a PR for you shortly. |
cemerick
added a commit
to cemerick/yaml
that referenced
this issue
Oct 27, 2022
cemerick
added a commit
to cemerick/yaml
that referenced
this issue
Oct 27, 2022
cemerick
added a commit
to cemerick/yaml
that referenced
this issue
Oct 27, 2022
cemerick
added a commit
to cemerick/yaml
that referenced
this issue
Oct 27, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
yaml/src/stringify/stringifyCollection.ts
Line 158 in 8e7e57f
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. 😄 )
The text was updated successfully, but these errors were encountered: