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

display the line numbers using sphinx.ext.viewcode? #10589

Closed
12rambau opened this issue Jun 20, 2022 · 3 comments
Closed

display the line numbers using sphinx.ext.viewcode? #10589

12rambau opened this issue Jun 20, 2022 · 3 comments
Labels
extensions type:enhancement enhance or introduce a new feature

Comments

@12rambau
Copy link

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.

@12rambau 12rambau added the type:enhancement enhance or introduce a new feature label Jun 20, 2022
@12rambau
Copy link
Author

comment that could lead to a PR, I found this bit of code in the viewcode extention,

highlighted = highlighter.highlight_block(code, lexer, linenos=False)

If I understand how to create a new configuration parameter I could change its value and add line number as well.

@tk0miya
Copy link
Member

tk0miya commented Jul 16, 2022

PR is welcome. Please use add_config_value() to add a new configuration variable.

@AA-Turner
Copy link
Member

Closed by #6319.

A

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants