我正在使用Sphinx在网页上记录部分Javascript代码。
我用
.. literalinclude:: ../examples/mapviz-step1-simple.html
:language: javascript
:lines: 47-51
:linenos:
我得到了
代码段来自实际源代码文件的第47-51行,而不是1-5。
如何显示实际行号以及此代码段?
答案 0 :(得分:5)
在2011年提出问题时,这是不可能的,但现在有一个lineno-start
功能(在Sphinx 1.3中添加)。请参阅此增强请求:https://github.com/sphinx-doc/sphinx/issues/668。
答案 1 :(得分:2)
Sphinx 1.3 will have lineno-start
功能仅用于此目的。