2017-09-23 54 views
2

我想在github中創建一個markdown文件,並且想在其中放入一個svg圖像。 github根本沒有渲染圖像。我嘗試了<img />,與![]()。根本不工作!任何人都見過這個?github svg根本沒有渲染

剛修改的存儲庫,以便爲公衆:https://github.com/michelucci/deepbook

由於提前,翁貝託

+0

你可以分享鏈接? – Mureinik

+0

當然...只是修改爲公共存儲庫... https://github.com/michelucci/deepbook – Umberto

回答

0

GitHub的降價似乎阻止SVG文件,但你可以隨時使用裸露的HTML標籤:

<img src="neuron_fig1.svg"/> 
+0

謝謝。我試過了(見庫)。但沒有出現! – Umberto

+0

@Umberto如果你想使用完全限定的鏈接而不是相對的鏈接,你需要使用'raw.githubusercontent.com',即:'https://raw.githubusercontent.com/michelucci/deepbook/master/images/neuron_fig1 .svg'。 – Mureinik

+0

謝謝。我也試過你的解決方案,只是指向文件本身,但沒有顯示任何東西。我會嘗試一個完全合格的鏈接... – Umberto

0

請參閱issue 458關於任何內嵌HTML,但由於它不是您的問題,您可以比較your pagethis 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." 
    ] 
+0

我相信你!但在我的情況是沒有顯示任何東西......也許是如何編寫SVG。我用inkscape生成它們... – Umberto

+0

@Umberto我已經添加了你當前的代碼來比較我發現工作的例子。 – VonC

+0

Thanks,'''![Python Float](fig/python_float.svg)'''與我的類似(注意我將圖像移動到了我的根目錄以查看是否有幫助),但仍然沒有運氣。 。我沒有看到任何區別(除了我指的是在同一根目錄中的圖像)...哦,順便說一句,它完美的作品(我更新了文件)。 – Umberto