Skip to content

Latest commit

 

History

History
245 lines (215 loc) · 11.1 KB

File metadata and controls

245 lines (215 loc) · 11.1 KB

Hosting Service URL Pattern and API Reference

The URLs of Hosting services such as GitHub, GitLab and Bitbucket have their patterns. Thus we can use these patterns to programably compose the URL of a file or the repo on a specific commit rather than manually clicking through several links in a row to get what we want. They also provide their own APIs for doing that, which sometimes are more intuitive to use.

Below is a collection of the patterns and APIs that are used in MLHub to construct the URLs for MLHub package installation from these hosting services.

Notation

  • :owner -- Account/Username, such as simonzhaoms
  • :repo -- Repo name, such as tips
  • :branch -- Branch name, such as master
  • :sha -- Commit hash, such as 093fc07
  • :path -- File/directory path, such as tips/github/compose-github-links.md
  • :tag -- Tag name, such as v1.0
  • :release -- Release name, such as v2.0
  • :number -- Pull request number, such as 9

GitHub

Web URL

API URL

Reference

GitLab

Web URL

API URL

Reference

Bitbucket

Web URL

API URL

Reference