From f892cdff0f71456c090ed184da47848d55ed65d0 Mon Sep 17 00:00:00 2001 From: Ben Fradet Date: Wed, 24 May 2017 19:28:04 +0100 Subject: [PATCH] Make gh4s doc structure reflect gh doc structure --- docs/src/main/tut/activity.md | 7 ++++--- docs/src/main/tut/issue.md | 20 ++++++++++-------- docs/src/main/tut/pull_request.md | 35 ++++++++++++++++++------------- docs/src/main/tut/repository.md | 34 +++++++++++++++++------------- docs/src/main/tut/user.md | 13 ++++++------ 5 files changed, 62 insertions(+), 47 deletions(-) diff --git a/docs/src/main/tut/activity.md b/docs/src/main/tut/activity.md index f2ffec49f..898b02e50 100644 --- a/docs/src/main/tut/activity.md +++ b/docs/src/main/tut/activity.md @@ -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: @@ -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 \ No newline at end of file +[activity-scala]: https://github.com/47deg/github4s/blob/master/github4s/shared/src/main/scala/github4s/free/domain/Activity.scala diff --git a/docs/src/main/tut/issue.md b/docs/src/main/tut/issue.md index 752a57728..6bab78623 100644 --- a/docs/src/main/tut/issue.md +++ b/docs/src/main/tut/issue.md @@ -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: diff --git a/docs/src/main/tut/pull_request.md b/docs/src/main/tut/pull_request.md index 2bbb81c9d..c19c27ee6 100644 --- a/docs/src/main/tut/pull_request.md +++ b/docs/src/main/tut/pull_request.md @@ -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: @@ -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: @@ -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: @@ -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 { @@ -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: @@ -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: @@ -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: @@ -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 \ No newline at end of file +[pr-scala]: https://github.com/47deg/github4s/blob/master/github4s/shared/src/main/scala/github4s/free/domain/PullRequest.scala diff --git a/docs/src/main/tut/repository.md b/docs/src/main/tut/repository.md index 87ef42c99..b60fa1bef 100644 --- a/docs/src/main/tut/repository.md +++ b/docs/src/main/tut/repository.md @@ -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: @@ -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 @@ -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 @@ -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: @@ -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: diff --git a/docs/src/main/tut/user.md b/docs/src/main/tut/user.md index 8297b0c98..779061e80 100644 --- a/docs/src/main/tut/user.md +++ b/docs/src/main/tut/user.md @@ -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: @@ -26,7 +27,7 @@ import scalaj.http.HttpResponse val accessToken = sys.env.get("GITHUB4S_ACCESS_TOKEN") ``` -## User +## Users ### Get a user @@ -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 \ No newline at end of file +[user-scala]: https://github.com/47deg/github4s/blob/master/github4s/shared/src/main/scala/github4s/free/domain/User.scala