Try   HackMD
tags: HackMD筆記

HackMD 嵌入 PDF 做預覽

作者:啊綸

動機

原先是懶得將某次習題的手寫解答打成latex筆記,掃描成PDF後就直接上傳moodle

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

各種嘗試

後來整理自己的筆記時,想直接將PDF放進HackMD,發現教學筆記上是有這樣的功能的,就照著放上google drive

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

接著在HackMD輸入
{%pdf https://drive.google.com/file/d/1wUzxqGgW0bkcPwW-_fFdX9LcwtyURhwT/view?usp=sharing %}

結果。。。

摁,跟教學的不一樣呢(常見的事哈,跟電腦相關的技能我通常很難一次到位)

嘗試了各種雲端連結該怎麼用才能直接連結到我的PDF檔案後(這裡指的並不是在雲端上的google文件預覽畫面,剛剛的連結就是這個case),問了HackMD的官方粉專,對方說試試看放在**github**上

所以我就去碰之前不敢碰的傳說中的github了
所以我就去嘗試看看不太會用的github了

關於github的介面我就不多描述了,並不是這次的重點,我會著重在如何將github的PDF連結順利放進HackMD供作預覽用

好,假設我們都已經將檔案放上github,要開始貼連結了

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

我是直接把該網頁的連結複製起來,一樣在HackMD輸入
{%pdf https://github.com/ChinLun-Lu/File-of-TA/blob/master/HW7.pdf %}

還是失敗XD

最後問了學長,他研究後發現要將原檔案連結的 github.com 改成 raw.githubusercontent.com,並且要拿掉 blob

像這樣 {%pdf https://raw.githubusercontent.com/ChinLun-Lu/File-of-TA/master/HW7.pdf %}

It works !!!
太震驚的我決定記下來這招XD