sphinx
sphinx copied to clipboard
display the line numbers using sphinx.ext.viewcode?
I'm using the sphinx.ext.viewcode to document my API. Is it possible to display the line numbers on the produced code-block and if yes how ?
I've tried to find an html_option in the docs but I didn't find anything. As this question is on stale for a month on SO, I assumed it was not available in Sphinx so I'm moving it to a feature request.
comment that could lead to a PR, I found this bit of code in the viewcode extention, https://github.com/sphinx-doc/sphinx/blob/93226ca91acdba7fdf0c7efde27ccc9c28cf7ece/sphinx/ext/viewcode.py#L251
If I understand how to create a new configuration parameter I could change its value and add line number as well.
PR is welcome. Please use add_config_value() to add a new configuration variable.
Closed by #6319.
A