Custom formatting for really long "special" String? #594
Unanswered
nielsbasjes
asked this question in
Q&A
Replies: 2 comments 4 replies
-
I have tried to insert newlines and that did not have the desired effect:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Formatting the output in the way you suggest is currently not supported by Kaml. It might be possible to add an annotation that tells Kaml to use a particular style when writing the value - would you be interested in putting together a PR to do this? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a usecase where I have a list of registers values that I want to read and write to a yaml file.
To illustrate a snippet of my input (manually created to look like this)
That I can read with this
After that a parser will convert this String into something my code will work with.
I would like the reverse to be "the same" in terms of readability of the produced output.
When I simply write the data back to yaml (using a simple toString that creates a single line) I get this (snippet of full output):
At the technical level this is correct and works fine.
Yet I would like to have it formatted as shown in the original input; a block with a '|' , no quotes and on every 16th element a newline (because of hex addresses).
I can provide the desired values (now a too simple toString) in any format to meet this.
How do I massage my code to produce this output?
Beta Was this translation helpful? Give feedback.
All reactions