我正在尝试在github中创建一个markdown文件,并希望在其中放入一个svg图像。 github根本不渲染图像。我尝试使用<img />
和![]()
。根本就不行!有谁见过这个?
刚刚修改了存储库,以便公开:https://github.com/michelucci/deepbook
在此先感谢,翁贝托
GitHub的降价似乎阻止了SVG文件,但您始终可以使用裸HTML标记:
<img src="neuron_fig1.svg"/>
请参阅issue 458关于任何内联HTML,但由于它不是你的问题,你可以比较your page和this one:它确实显示了很多svg图片,以及它的source is here。
"source": [
"## Python Objects\n",
"\n",
"We begin with a look at a Python object. In Python, objects are stored in memory blocks independently allocated on the heap. A single floating point value looks something like this:\n",
"\n",
"![Python Float](fig/python_float.svg)\n",
"\n",
"This doesn’t look too bad, in a dynamically typed system we need to store some metadata about the type, and we need to store the data containing the value."
]
},
所以相对URL(到docs/intro-01/fig
)确实有效。
你的代码:
"source": [
" ![](neuron_fig1.svg) \n",
" **Fig. 1** The structure of a neuron. $x_i$ are the input, $w_i$ are the weights."
]
看起来GitHub现在需要在SVG字符串末尾的http查询参数sanitize=true
。如果您从Wiki中链接到存储库中的图像,则可能已在URL的末尾添加了参数。因此,如果没有查询参数,则添加?sanitize=true
,否则添加&sanitize=true
<img alt="my image" src="https://raw.githubusercontent.com/user/branch/images/myimage.svg?example=foo&sanitize=true>