Small array/object values are often better rendered inline for readability (for instance, [255, 165, 0] being an RGB color). There are two approaches that work for this:
- Define a heuristic for when values should be inlined. This can incorporate the number of children, child types/comments, and/or the length of the generated text.
- Allow nodes to store rendering options, thus leaving the decision to the serializer. This would fit in well with a general node options system and also support other rendering options like integer/decimal bases or comment style/postion.
I think short-term I'm going to add a heuristic for my needs, but later on a general system for node options is the right move.
Small array/object values are often better rendered inline for readability (for instance,
[255, 165, 0]being an RGB color). There are two approaches that work for this:I think short-term I'm going to add a heuristic for my needs, but later on a general system for node options is the right move.