marcusaram / snakeyaml

Automatically exported from code.google.com/p/snakeyaml
Apache License 2.0
1 stars 0 forks source link

Preserve YAML comments when roundtripping... #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We use YAML as a configuration language in our Okapi localization framework
(http://code.google.com/p/okapi/) - it would be great if SnakeYaml could
preserve our comments when we load then dump our yaml files. Otherwise
SnakeYaml dump is very clean! 

Original issue reported on code.google.com by jhargrav...@gmail.com on 17 Sep 2009 at 8:54

GoogleCodeExporter commented 9 years ago

Original comment by aso...@gmail.com on 17 Sep 2009 at 10:13

GoogleCodeExporter commented 9 years ago
It is the same as the issue for PyYAML:
http://pyyaml.org/ticket/114

Since there is no easy and clean solution I would recommend to discuss the 
problem in
yaml-core mailing list.

Original comment by aso...@gmail.com on 17 Sep 2009 at 10:22

GoogleCodeExporter commented 9 years ago
Can you please show an example of the YAML file where you wish to keep the 
comments ?

Original comment by py4fun@gmail.com on 25 Sep 2009 at 8:58

GoogleCodeExporter commented 9 years ago
Here's a sample config file

Original comment by jhargrav...@gmail.com on 25 Sep 2009 at 11:47

Attachments:

GoogleCodeExporter commented 9 years ago
It is a rather complex hierarchy of comments. I see a few possible solutions:
1) custom dumper
2) annotations
3) settings similar to TypeDescription
Any approach would require a considerable code change in SnakeYAML. I think we 
shall 
try all approaches to see the impact on the code.
I will have a deeper look once I have more time.

Original comment by py4fun@gmail.com on 12 Oct 2009 at 12:16

GoogleCodeExporter commented 9 years ago
see the proposal
http://groups.google.com/group/snakeyaml-core/browse_frm/thread/451e71a7397120df

Original comment by aso...@gmail.com on 17 Nov 2009 at 12:22

GoogleCodeExporter commented 9 years ago
a possible solution is here http://code.google.com/p/snakeyaml/wiki/
Documentation#Dumping_a_custom_YAML_document

Original comment by py4fun@gmail.com on 18 Nov 2009 at 2:56