From 46756155182b6f9098b73f1f4298261a8fce7e79 Mon Sep 17 00:00:00 2001 From: Greg Messner Date: Sun, 23 Mar 2014 17:04:53 -0700 Subject: [PATCH] Cleaned up markdown. --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 177d02d9..2b592093 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,62 @@ -gitlab-api -========== +gitlab-api for Java +=================== This project provides a full featured Java API for working with GitLab repositories via the standard GitLab REST API. It is quite simple to use, all you need is the URL to your GitLab server and the Private Token from your GitLab Account Settings page. Once you have that info it is as simple as: -'''java +```java // Create a GitLabApi instance to communicate with your GitLab server GitLabApi gitLabApi = new GitLabApi("http://your.gitlab.serbver.com", "YOUR_PRIVATE_TOKEN"); // Get the list of projects your account has access to List projects = gitLabApi.getProjectApi().getProjects(); -''' +``` The API has been broken up into sub APIs classes to make it easier to learn and to separate concerns. Following is a list of the sub APIs along with a sample use of each API. See the Javadocs for a complete list of available methods for each sub API. Available Sub APIs ------------------ -''' +``` CommitsApi GroupApi MergeRequestApi ProjectApi RepositoryApi UserApi -''' +``` CommitsApi: -'''java +```java // Get a list of commits associated with the specified branch List commits = gitLabApi.getgetCommitsApi().getCommits(1234, "new-feature"); -''' +``` GroupApi: -'''java +```java // Get a list of groups that you have access to List groups = gitLabApi.getGroupApi().getGroups(); -''' +``` MergeRequestApi: -'''java +```java // Get a list of the merge requests for the specified project List mregeRequests = gitLabApi.getMergeRequestApi().getMergeRequests(1234); -''' +``` ProjectApi: -'''java +```java // Get a list of accessible projects public List projects = gitLabApi.getProjectApi().getProjects(); -''' +``` RepositoryApi: -'''java +```java // Get a list of repository branches from a project, sorted by name alphabetically List branches = gitLabApi.getRepositoryApi().getBranches(); -''' +``` UserApi: -'''java +```java // Get the User info for user_id 1 User user = gitLabApi.getUserApi().getUser(1); -''' +``` -- GitLab