Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whitespace trimming in YIN->YANG conversion #44

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 5 comments
Closed

whitespace trimming in YIN->YANG conversion #44

GoogleCodeExporter opened this issue Mar 16, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

When doing the translation from YIN to YANG, it would be helpful to apply some 
whitespace trimming in 'description' arguments and similar strings, otherwise 
the result is ugly when theses strings are naturally indented in the YIN XML 
source. A typical result is:

  description
    "
                 Time To Live (or hop count in IPv6 terminology) that is
                 set in the IP headers of the (outer) tunnel packets. By
                 default, the tunnel packets inherit the value from the
                 inner (tunneled) packets.
                     ";


The trimming rule could be that all leading and trailing whitespace is removed 
and the second and following lines are justifed relative to the first line so 
that the above description would become

  description
    "Time To Live (or hop count in IPv6 terminology) that is
     set in the IP headers of the (outer) tunnel packets. By
     default, the tunnel packets inherit the value from the
     inner (tunneled) packets.";


Original issue reported on code.google.com by lada.lho...@gmail.com on 10 Jun 2010 at 6:34

@GoogleCodeExporter
Copy link
Author

Proposal: Make a new option --yang-pretty-strings, symmetrical to 
--yin-pretty-strings.

Original comment by lada.lho...@gmail.com on 25 Jun 2010 at 1:19

@GoogleCodeExporter
Copy link
Author

I think the pretty strings need to be handled at input time, i.e. in 
yin_parser.  So it would be better to add an option to read pretty yin strings. 
 Feel free to help out with this :)

Original comment by mbj4...@gmail.com on 28 Jun 2010 at 7:32

@GoogleCodeExporter
Copy link
Author

The point is that a pretty-printed string is different for YANG and YIN, so 
when typing in YIN, the strings are indented to look reasonably as a multiline 
text of an XML element whereas in YANG the indentation is different.

My problem is that I prefer to input YIN using nxml-mode but when publishing 
such modules it is generally better to use the YANG syntax. Currently the only 
option is to reformat descriptions etc. manually. 

Original comment by lada.lho...@gmail.com on 1 Jul 2010 at 1:41

@GoogleCodeExporter
Copy link
Author

I think this one should be closed?

Original comment by mbj4...@gmail.com on 30 Aug 2010 at 7:26

@GoogleCodeExporter
Copy link
Author

A new pyang command-line option "--trim-yin" was added that does this 
whitespace trimming in the argument of 'contact', 'description', 
'error-message', 'organization', and 'reference'. Closing the issue.

Original comment by lada.lho...@gmail.com on 31 Aug 2010 at 8:54

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant