有没有办法在源存储库中引用源文件(文件和行),而无需在ReST中明确写入repo URL?像
这样的东西# conf.py:
repo_root="http://github.com/some/project"
# something.rst
A good example of this is found in :repo:`examples/ex1.py`/ or :repo:`examples/ex1.py`.
答案 0 :(得分:2)
使用sphinx.ext.extlinks扩展程序。例如:
extlinks = {'repo': ('http://github.com/some/project/%s', 'repo ')}