Seth E
Seth E

Reputation: 1113

How can I create relative links from my MarkDown to GitHub raw files?

GitHub MD supports relative links, for example from my README.md I can link to code in the Code directory:

To download these scripts, [click here](Code/myscript.sh), then right-click the **Raw** button and download it

How can I directly link to the raw content, using a relative link like Code/myscript.sh (not an absolute link like https://raw.githubusercontent.com/myrepo/toplevel/subdir/subsubdir/myscript.sh)?

Upvotes: 6

Views: 1586

Answers (1)

Seth E
Seth E

Reputation: 1113

append raw=1 to your URL

To download these scripts, [click here](Code/myscript.sh?raw=1).

I did not find this documented anywhere and discovered it by experimentation, so sharing it here.

Upvotes: 12

Related Questions