Syntax highlighting for data files #11448

Open
opened 2025-12-29 21:45:20 +01:00 by adam · 5 comments
Owner

Originally created by @tobiasge on GitHub (Aug 2, 2025).

NetBox version

v4.3.5

Feature type

New functionality

Proposed functionality

Syntax highlighting on the data files details page.

Use case

Better readability of the content from data files.

Database changes

  • None

External dependencies

Python Pygments as a direct dependency. It's already installed as a dependency of mkdocs-material.

Originally created by @tobiasge on GitHub (Aug 2, 2025). ### NetBox version v4.3.5 ### Feature type New functionality ### Proposed functionality Syntax highlighting on the data files details page. ### Use case Better readability of the content from data files. ### Database changes - None ### External dependencies [Python Pygments](https://pygments.org/#) as a direct dependency. It's already installed as a dependency of `mkdocs-material`.
adam added the type: featurestatus: needs ownernetboxcomplexity: low labels 2025-12-29 21:45:20 +01:00
Author
Owner

@tobiasge commented on GitHub (Aug 2, 2025):

I'm willing to implement this.

@tobiasge commented on GitHub (Aug 2, 2025): I'm willing to implement this.
Author
Owner

@jeremystretch commented on GitHub (Aug 7, 2025):

Syntax highlighting on the data files details page.

Please elaborate on the proposed implementation.

@jeremystretch commented on GitHub (Aug 7, 2025): > Syntax highlighting on the data files details page. Please elaborate on the proposed implementation.
Author
Owner

@tobiasge commented on GitHub (Aug 7, 2025):

At the moment the content of synchronized files in a data source is rendered as plain text in a <pre>. I think it would be more readable if it were displayed with lines numbers and keyword like def in Python highlighted in colours, like Github displays files.

With Pygments the type of the content can be guessed based on the file extension. Then the contents can be rendered as HTML with coloured keywords.

@tobiasge commented on GitHub (Aug 7, 2025): At the moment the content of synchronized files in a data source is rendered as plain text in a `<pre>`. I think it would be more readable if it were displayed with lines numbers and keyword like `def` in Python highlighted in colours, like Github displays files. With [Pygments](https://pygments.org/#) the type of the content can be guessed based on the file extension. Then the contents can be rendered as HTML with coloured keywords.
Author
Owner

@jeremystretch commented on GitHub (Aug 14, 2025):

I'm okay opening this for work provided the implementation is fairly straightforward.

@jeremystretch commented on GitHub (Aug 14, 2025): I'm okay opening this for work provided the implementation is fairly straightforward.
Author
Owner

@tobiasge commented on GitHub (Aug 14, 2025):

You can assign the issue to me.

@tobiasge commented on GitHub (Aug 14, 2025): You can assign the issue to me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11448