你需要使用
raw.githubusercontent.com
而不是
github.com
:
.. image:: https://github.com/thebjorn/pydeps/blob/master/docs/_static/pydeps-pylib.svg
将仅在Github本身上正确呈现,而
.. image:: https://raw.githubusercontent.com/thebjorn/pydeps/master/docs/_static/pydeps-pylib.svg?sanitize=true
首次尝试(已断开并删除)
第二次尝试:
-
正确替换URL(同时删除
blob
分道扬镳-我的错,
-
附加物
?sanitize=true
每个被替换的URL。
$ sed -i '' 's,.. image:: https://github.com/\(.*\)/blob/\(.*\).svg,.. image:: https://raw.githubusercontent.com/\1/\2.svg?sanitize=true,g' README.rst
on Github
和
on TestPyPI
,都很好看。
另一种可能是
罗吉特
$ sed -i '' 's,.. image:: https://github.com/\(.*\)/blob/\(.*\)$,.. image:: https://cdn.rawgit.com/\1/\2,g' README.rst