Anymarkup does not support comments
For formats where it's possible, we would like to be able to add comments to files generated by anymarkup.
See: https://github.com/projectatomic/atomicapp/issues/178
Heh, so this is interesting. The biggest issue here is that a comment is actually a syntactic element in XML. There's no real syntax for INI files, but most INI parsers also recognize INI comments. For JSON and Yaml, this would be much more complicated. In fact, the Yaml specification forbids parsing comments altogether [1].
It should be possible to provide comments serialization in XML and INI and ignore these in Yaml and JSON. I'd have to rewrite the INI parsing logic first to return OrderedDict, but that shouldn't be a big deal; XML parsing already returns that. Then I'd have to decide on a special key in the returned structures that would represent comments, something like #comment-follows-this-is-very-unique-so-we-can-be-sure-noone-actually-uses-that-as-key. Or similar :)
I think this should also be an argument for API functions to explicitly say that I want/don't want to parse/serialize comments.
Would that that sufficient for you?
[1] http://yaml.org/spec/current.html#comment/information%20model
@bkabrda +1 to your proposal.
Would it be possible to read INI files with comments as well as write out comments?
Yeah, absolutely. I'll try to get to this ASAP, but unfortunately I have no idea when that'll be.