Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make gh4s doc structure reflect gh doc structure #152

Merged
merged 1 commit into from
May 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/src/main/tut/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ title: Activity API
# Activity API

Github4s supports the [Activity API](https://developer.github.com/v3/activity/). As a result,
with Github4s, you can:
with Github4s, you can interact with:

- [Set a thread subscription](#set-a-thread-subscription)
- [Notifications](#notifications)
- [Set a thread subscription](#set-a-thread-subscription)

The following examples assume the following imports and token:

Expand Down Expand Up @@ -59,4 +60,4 @@ As you can see, a few features of the activity endpoint are missing.

As a result, if you'd like to see a feature supported, feel free to create an issue and/or a pull request!

[activity-scala]: https://github.com/47deg/github4s/blob/master/github4s/shared/src/main/scala/github4s/free/domain/Activity.scala
[activity-scala]: https://github.com/47deg/github4s/blob/master/github4s/shared/src/main/scala/github4s/free/domain/Activity.scala
20 changes: 11 additions & 9 deletions docs/src/main/tut/issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ title: Issue API
# Issue API

Github4s supports the [Issue API](https://developer.github.com/v3/issues/). As a result,
with Github4s, you can:

- [Create an issue](#create-an-issue)
- [Edit an issue](#edit-an-issue)
- [List issues](#list-issues)
- [Search issues](#search-issues)
- [Create a Comment](#create-a-comment)
- [Edit a Comment](#edit-a-comment)
- [Delete a Comment](#delete-a-comment)
with Github4s, you can interact with:

- [Issues](#issues)
- [Create an issue](#create-an-issue)
- [Edit an issue](#edit-an-issue)
- [List issues](#list-issues)
- [Search issues](#search-issues)
- [Comments](#comments)
- [Create a Comment](#create-a-comment)
- [Edit a Comment](#edit-a-comment)
- [Delete a Comment](#delete-a-comment)

The following examples assume the following imports and token:

Expand Down
35 changes: 20 additions & 15 deletions docs/src/main/tut/pull_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ title: Pull Request API
# Pull Request API

Github4s supports the [Pull Request API](https://developer.github.com/v3/pulls/). As a result,
with Github4s, you can:
with Github4s, you can interact with:

- [List pull requests](#list-pull-requests)
- [List the files in a pull request](#list-the-files-in-a-pull-request)
- [Create a pull request](#create-a-pull-request)
- [List reviews](#list-pull-request-reviews)
- [Get a review](#get-an-individual-review)
- [Pull requests](#pull-requests)
- [List pull requests](#list-pull-requests)
- [List the files in a pull request](#list-the-files-in-a-pull-request)
- [Create a pull request](#create-a-pull-request)
- [Reviews](#reviews)
- [List reviews](#list-pull-request-reviews)
- [Get a review](#get-an-individual-review)

The following examples assume the following imports and token:

Expand All @@ -33,7 +35,9 @@ They also make use of `cats.Id`, but any type container implementing `MonadError
Support for `cats.Id`, `cats.Eval`, and `Future` (the only supported option for scala-js) are
provided out of the box when importing `github4s.{js,jvm}.Implicits._`.

## List pull requests
## Pull requests

### List pull requests

You can list the pull requests for a repository using `list`; it takes as arguments:

Expand All @@ -58,7 +62,7 @@ The `result` on the right is the matching [List[PullRequest]][pr-scala].

See [the API doc](https://developer.github.com/v3/pulls/#list-pull-requests) for full reference.

## List the files in a pull request
### List the files in a pull request

You can also list the files for a pull request using `listFiles`; it takes as arguments:

Expand All @@ -67,7 +71,7 @@ You can also list the files for a pull request using `listFiles`; it takes as ar

To list the files for a pull request:

```scala
```tut:silent
val listPullRequestFiles = Github(accessToken).pullRequests.listFiles("47deg", "github4s", 102)

listPullRequestFiles.exec[cats.Id, HttpResponse[String]]() match {
Expand All @@ -81,8 +85,9 @@ the `result` on the right is the [List[PullRequestFile]][pr-scala].
See [the API doc](https://developer.github.com/v3/pulls/#list-pull-requests-files) for full
reference.

## Create a pull request
If you want to create a pull request, you can follow two different methods.
### Create a pull request

If you want to create a pull request, we can follow two different methods.

On the one hand, we can pass the following parameters:

Expand Down Expand Up @@ -130,9 +135,9 @@ createPullRequestIssue.exec[cats.Id, HttpResponse[String]]() match {

See [the API doc](https://developer.github.com/v3/pulls/#create-a-pull-request) for full reference.

# Review API
## Reviews

## List pull request reviews
### List pull request reviews

You can list the reviews for a pull request using `listReviews`; it takes as arguments:

Expand All @@ -157,7 +162,7 @@ The `result` on the right is the matching [List[PullRequestReview]][pr-scala].

See [the API doc](https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request) for full reference.

## Get an individual review
### Get an individual review

You can get an individual review for a pull request using `getReview`; it takes as arguments:

Expand Down Expand Up @@ -187,4 +192,4 @@ See [the API doc](https://developer.github.com/v3/pulls/reviews/#get-a-single-re
As you can see, a few features of the pull request endpoint are missing. As a result, if you'd like
to see a feature supported, feel free to create an issue and/or a pull request!

[pr-scala]: https://github.com/47deg/github4s/blob/master/github4s/shared/src/main/scala/github4s/free/domain/PullRequest.scala
[pr-scala]: https://github.com/47deg/github4s/blob/master/github4s/shared/src/main/scala/github4s/free/domain/PullRequest.scala
34 changes: 20 additions & 14 deletions docs/src/main/tut/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ title: Repository API
# Repository API

Github4s supports the [Repository API](https://developer.github.com/v3/repos/). As a result,
with Github4s, you can:

- [Get a repository](#get-a-repository)
- [List contributors](#list-contributors)
- [List commits on a repository](#list-commits-on-a-repository)
- [Get contents](#get-contents)
- [Create a release](#create-a-release)
- [Create a status](#create-a-status)
- [List status for a specific Ref](#list-status-for-a-specific-ref)
- [Get the combined status of a specific Ref](#get-the-combined-status-for-a-specific-ref)
with Github4s, you can interact with:

- [Repositories](#repositories)
- [Get a repository](#get-a-repository)
- [List contributors](#list-contributors)
- [Commits](#commits)
- [List commits on a repository](#list-commits-on-a-repository)
- [Contents](#contents)
- [Get contents](#get-contents)
- [Releases](#releases)
- [Create a release](#create-a-release)
- [Statuses](#statuses)
- [Create a status](#create-a-status)
- [List status for a specific Ref](#list-status-for-a-specific-ref)
- [Get the combined status of a specific Ref](#get-the-combined-status-for-a-specific-ref)

The following examples assume the following imports and token:

Expand All @@ -35,7 +40,8 @@ They also make use of `cats.Id`, but any type container implementing `MonadError

Support for `cats.Id`, `cats.Eval`, and `Future` (the only supported option for scala-js) are
provided out of the box when importing `github4s.{js,jvm}.Implicits._`.
## Repository

## Repositories

### Get a repository

Expand Down Expand Up @@ -186,7 +192,7 @@ The `result` on the right is the created [Release][repository-scala].
See [the API doc](https://developer.github.com/v3/repos/releases/#create-a-release) for full
reference.

## Status
## Statuses

### Create a status

Expand Down Expand Up @@ -214,7 +220,7 @@ The `result` on the right is the created [Status][repository-scala].
See [the API doc](https://developer.github.com/v3/repos/statuses/#create-a-status) for full
reference.

### List status for a specific Ref
### List statuses for a specific ref

You can also list statuses through `listStatuses`; it take as arguments:

Expand All @@ -238,7 +244,7 @@ The `result` on the right is the corresponding [List[Status]][repository-scala].
See [the API doc](https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref)
for full reference.

### Get the combined status for a specific Ref
### Get the combined status for a specific ref

Lastly, you can also get the combined status thanks to `getCombinedStatus`; it takes the same
arguments as the operation listing statuses:
Expand Down
13 changes: 7 additions & 6 deletions docs/src/main/tut/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ title: User API
# User API

Github4s supports the [User API](https://developer.github.com/v3/users/). As a result,
with Github4s, you can:
with Github4s, you can interacts with:

- [Get a user](#get-a-user)
- [Get an authenticated user](#get-an-authenticated-user)
- [Get a list of users](#get-a-list-of-users)
- [Users](#users)
- [Get a user](#get-a-user)
- [Get an authenticated user](#get-an-authenticated-user)
- [Get a list of users](#get-a-list-of-users)

The following examples assume the following imports and token:

Expand All @@ -26,7 +27,7 @@ import scalaj.http.HttpResponse
val accessToken = sys.env.get("GITHUB4S_ACCESS_TOKEN")
```

## User
## Users

### Get a user

Expand Down Expand Up @@ -91,4 +92,4 @@ As you can see, a few features of the user endpoint are missing.

As a result, if you'd like to see a feature supported, feel free to create an issue and/or a pull request!

[user-scala]: https://github.com/47deg/github4s/blob/master/github4s/shared/src/main/scala/github4s/free/domain/User.scala
[user-scala]: https://github.com/47deg/github4s/blob/master/github4s/shared/src/main/scala/github4s/free/domain/User.scala