[DOCS-32] Add YANG pygment to do syntax highlighting of YANG code in reST Created: 11/Oct/16  Updated: 13/Apr/21  Resolved: 13/Apr/21

Status: Closed
Project: docs
Component/s: Toolchain
Affects Version/s: unspecified
Fix Version/s: Aluminium

Type: Bug
Reporter: Colin Dixon Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 6928

 Description   

The subject says it all. Pygments are described here:
http://pygments.org/

My guess is that we can use our current YANG lexer to make this easy, but I don't know how easy.



 Comments   
Comment by Robert Varga [ 27/Jan/17 ]

https://github.com/vkosuri/lang-yang
https://github.com/apackeer/sublime-yang-syntax

are two highlighters, which could be used as a baseline for getting something up and running.

Comment by Colin Dixon [ 02/Apr/17 ]

This appears to be a functional lexer:
https://github.com/cmoberg/pygments-yang-lexer

It's from Carl Moberg, who was at tail-f and is now at Cisco seems to have written it.

Comment by Thanh Ha (zxiiro) [ 11/Aug/20 ]

This was merged officially into pygments https://github.com/pygments/pygments/commit/04b4d08cf6bd8b0b7d0ca17de448ad950d81ea64 so should become available in the next release of pygments. Whenever that is.

Expecting version either 2.6.2 or 2.7.x maybe.

Generated at Wed Feb 07 19:58:29 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.