我正在使用Sphinx在网页上记录部分Javascript代码。
我用
.. literalinclude:: ../examples/mapviz-step1-simple.html
:language: javascript
:lines: 47-51
:linenos:
我懂了
该代码段来自实际源代码文件的47-51行,而不是1-5行。
如何显示实际的行号以及此代码段?
最佳答案
当在2011年提出此问题时,这是不可能的,但是自Sphinx 1.3起,就有了lineno-start
选项。请参阅以下增强请求:https://github.com/sphinx-doc/sphinx/issues/668。
当前文档:
literalinclude
code-block
关于python-sphinx - 狮身人面像,literalinclude,linenos : How to display the actual line numbers from the source code file on the doc's code snippet?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6867961/