cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
148
Views
0
Helpful
1
Replies
Beginner

yanger: Generate html document

Hi all,

NSO is using yanger to validate the yang models internally.

 

Is it possible to generate a HTML document based on defined yang model, like pyang does it?

 

If not: It is recommend to generate a HTML doc by pyang, although NSO is using only yanger?

 

Output of yanger help page:

$ yanger --help
Usage: yanger [-h] [-v] [--print-error-code] [-p <path>] [-P <plugindir>] [-c] [--strict] [-e] [-W <warning>] [-w <no_warning>]
              [-E <error>] [-f <format>] [-t <transform>] [--deviation-module <deviation_module>] [-F <features>] [-o <outfile>]
              [--no-deviation-apply] [--print] [--print-all] <file>...
[...]
-f, --format                      Convert to FORMAT.  Supported formats are: fxs,jsoninfo,sn,swagger,tree,yang.

Output of pyang help page:

$ pyang --help 
Usage: pyang [options] [<filename>...]
Validates the YANG module in <filename> (or stdin), and all its dependencies.
Options:
[...]
-f FORMAT, --format=FORMAT Convert to FORMAT. Supported formats are: dsdl, depend, sample-xml-skeleton, omni, yin, tree, html, jstree, capability, yang, xsd, uml, rest-doc, jtox, jsonxsl

Thanks

Everyone's tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: yanger: Generate html document

There is no HTML output format for Yanger.

 

The closest thing is a two step procedure where Swagger (for RESTCONF) can be generated with Yanger and saved to file

yanger -t expand -f swagger example-jukebox.yang > example-jukebox.yang.swagger.json

 This file can then be viewed with Swagger/OpenAPI tools, e.g. Swagger UI.

1 REPLY 1
Cisco Employee

Re: yanger: Generate html document

There is no HTML output format for Yanger.

 

The closest thing is a two step procedure where Swagger (for RESTCONF) can be generated with Yanger and saved to file

yanger -t expand -f swagger example-jukebox.yang > example-jukebox.yang.swagger.json

 This file can then be viewed with Swagger/OpenAPI tools, e.g. Swagger UI.