Skip to content

Commit d890eec

Browse files
committed
Add gist comments docs
1 parent 6e268e3 commit d890eec

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

doc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ APIs:
66
* [Commits](commits.md)
77
* [Enterprise](enterprise.md)
88
* [Gists](gists.md)
9+
* [Comments](gists/comments.md)
910
* [Issues](issues.md)
1011
* [Comments](issue/comments.md)
1112
* [Labels](issue/labels.md)

doc/gists.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
## Gists API
22
[Back to the navigation](README.md)
33

4-
Creating, editing, deleting and listing gists. Wraps [GitHub Gists API](http://developer.github.com/v3/gists/).
4+
Creating, editing, deleting and listing gists.
5+
Wraps [GitHub Gists API](http://developer.github.com/v3/gists/).
6+
7+
Additional APIs:
8+
* [Comments](gists/comments.md)
59

610
#### List all public gists.
711

doc/gists/comments.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Gists / Comments API
2+
3+
[Back to the "Gists API"](../gists.md) | [Back to the navigation](../README.md)
4+
5+
Wraps [GitHub Issue Comments API](http://developer.github.com/v3/gists/comments/).
6+
7+
### List a gist comments
8+
9+
```php
10+
// for gist https://gist.github.com/danvbe/4476697
11+
$comments = $client->api('gist')->comments()->all('4476697');
12+
```
13+
14+
* `4476697` : the id of the gist
15+
16+
### Show a gist comment
17+
18+
```php
19+
$comment = $client->api('gist')->comments()->show('4476697', '779656');
20+
```
21+
22+
* `4476697` : the id of the gist
23+
* `779656` : the id of the comment
24+
25+
### Create a gist comment
26+
27+
```php
28+
$client->api('gist')->comments()->create('4476697', 'Hello World');
29+
```
30+
31+
* `4476697` : the id of the gist
32+
* `Hello World` : the body of the comment
33+
34+
### Update a gist comment
35+
36+
```php
37+
$client->api('gist')->comments()->create('4476697', '123456', 'Hello Dolly');
38+
```
39+
40+
* `4476697` : the id of the gist
41+
* `123456` : the id of the comment
42+
* `Hello Dolly` : the body of the updated comment
43+
44+
### Remove a gist comment
45+
46+
```php
47+
$client->api('gist')->comments()->remove('4476697', '123456');
48+
```
49+
50+
* `4476697` : the id of the gist
51+
* `123456` : the id of the comment

0 commit comments

Comments
 (0)