Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
520 views
in Technique[技术] by (71.8m points)

hyperlink - Can I link to a file for downloading (other than PDF) in a GitHub wiki?

When you link to a PDF file using:

[download this](file.pdf)

it downloads the pdf file. I have an excel workbook that I'd like to allow someone to download using:

[download this](file.xlsx)

When I click it, it takes me to create a new page in the wiki. Is there any markdown syntax I can add that identifies the link as something to download?

If I have to, I can save the excel workbook as a PDF, but it's not going to be pretty.

Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

First, try making a files subdirectory in your wiki, and putting your files in there.

I tried using an html anchor tag

<a href="files/file.csv" download="file.csv">download this</a>

instead of the markdown link syntax

[download this](files/file.csv)

but it seems that GitHub wiki strips out the download attribute from the anchor tag.

In the end, I zipped my spreadsheet in a zip file and had the markdown link point to the zip file.

[download this](files/file.csv.zip)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...