You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to generate some github config files with Elixir. To do so I use a YAML template (too keep newlines and comments), but I have to inject bits of data inside.
To have better output capabilities, would you like to consider:
Allowing a fun/1 to be given as sort maps, in addition to boolean values. That function would return a term that would be used with Enum.sort_by/2. For instance:
# version first, then jobs, then sort by keysorter=fn{:version,_}->{0,1}{:jobs,_}->{0,2}{k,_}->{1,k}endYmlr.document!(data,sort_maps: sorter)
Provide a function to encode a document without the --- and starting at some arbitrary indentation level:
# version first, then jobs, then sort by keydefyaml(data,indent)doYmlr.value!(data,start_indent: indent)end
Hello,
I am trying to generate some github config files with Elixir. To do so I use a YAML template (too keep newlines and comments), but I have to inject bits of data inside.
For now I use JSON:
To have better output capabilities, would you like to consider:
Allowing a fun/1 to be given as sort maps, in addition to boolean values. That function would return a term that would be used with
Enum.sort_by/2
. For instance:Provide a function to encode a document without the
---
and starting at some arbitrary indentation level:What do you think about that?
The text was updated successfully, but these errors were encountered: