在GitHub文档中显示图像

时间:2017-01-01 07:52:19

标签: github

我有GitHub repository,我为此创建了Wiki。在所述Wiki中,有多个页面,例如我尝试放置图像的this one。出于某种原因,这些图像没有显示出来。

我指出的页面的Markdown代码如下所示:

# Getting started
* [Using protoype](#using-prototype)
* [Working on code](#working-on-code)
 * [Installation instructions](#installation-instructions)
 * [Front-end code](#front-end-code)
 * [Back-end code](#back-end-code)
 * [Database code](#database-code)

### Using prototype

1. Go [here](https://mikewarren.me/YALApp/test.html) for the prototype. It will take you to the login page, which should look like this: ![if you see this, it means you probably need to right-click this to open the image in a new tab](../blob/master/loginPage.png)
2. Click on blue bar labelled "Login" to select a sample profile.
3. Log in.

### Working on code

Comes in multiple parts: the installation instructions and the different layers of code. These are discussed below. When discussing the directories these are in, I shall use ~ to symbolize project root directory.

##### Installation instructions

This project is written in node.js and has a `package.json` file at ```~/home/ec2-user/GroupManagementAppServer```. You should be able to ```npm link``` the dependencies the project needs. The database connection is to a MySQL database, so I would recommend a MySQL database management system (I personally use phpMyAdmin) unless you plan on changing that to another (say, MongoDB to keep in the node.js spirit of things).

##### Front-end code

This can be accessed at ```~/var/www/html/YALApp```. JavaScript dependencies that are third-party libraries are one directory up from that. 

##### Back-end code

This is written in JavaScript, and can be accessed at ```~/home/ec2-user/GroupManagementAppServer```. Main file is `appServer.js`, and if you are intending to use SSL/TLS, you will have to spell out the pathnames of `privateKey`, `certificate`, and/or `intermediate`. The application uses port number `8080`, and `8443` for https. 

##### Database code

I don't have anything connected to the database yet, and thus had no real need to include the script here, but when I do, it will probably be in either ```~``` or ```~/home/ec2-user/GroupManagementAppServer/data```.

除了../blob/master/[pathToImage]之外,我不知道如何链接到可以在存储库中找到的图像。如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

尝试并指定您的仓库的完整网址,而不是相对路径。

请参阅“Linking to images in a repository

  

您可以通过在浏览器中复制URL并将其用作图像的路径来链接到GitHub上的存储库中的图像。
  例如,使用Markdown在wiki中嵌入图像可能如下所示:

[[https://github.com/username/repository/blob/master/img/octocat.png|alt=octocat]]