Skip to content

Commit 24be0ae

Browse files
ivoanjodblock
authored andcommitted
Add table of contents to readme and add note asking users to add their projects to the wiki (#125)
* Add table of contents to README Generated using gh-md-toc. * Add note to README asking users to add their projects to our wiki Closes #71 * Update changelog
1 parent a928527 commit 24be0ae

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### 0.8.6 (Next)
22

33
* [#122](https://github.com/codegram/hyperclient/pull/122): Improve error message when server returns invalid data - [@ivoanjo](https://github.com/ivoanjo).
4+
* [#125](https://github.com/codegram/hyperclient/pull/125): Add table of contents to readme and add note asking users to add their projects to the wiki - [@ivoanjo](https://github.com/ivoanjo).
45
* Your contribution here.
56

67
### 0.8.5 (July 5, 2017)

README.md

+35-13
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,29 @@
88

99
Hyperclient is a Hypermedia API client written in Ruby. It fully supports [JSON HAL](http://stateless.co/hal_specification.html).
1010

11-
## Usage
11+
* [Hyperclient](#hyperclient)
12+
* [Usage](#usage)
13+
* [API Client](#api-client)
14+
* [Resources and Attributes](#resources-and-attributes)
15+
* [Links and Embedded Resources](#links-and-embedded-resources)
16+
* [Templated Links](#templated-links)
17+
* [Curies](#curies)
18+
* [Attributes](#attributes)
19+
* [HTTP](#http)
20+
* [Asynchronous requests](#asynchronous-requests)
21+
* [Testing Using Hyperclient](#testing-using-hyperclient)
22+
* [Reference](#reference)
23+
* [Hyperclient Users](#hyperclient-users)
24+
* [Contributing](#contributing)
25+
* [License](#license)
26+
27+
<sub><sup>ToC created with [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)</sup></sub>
28+
29+
# Usage
1230

1331
The examples in this README use the [Splines Demo API](https://github.com/ruby-grape/grape-with-roar) running [here](https://grape-with-roar.herokuapp.com/api). If you're upgrading from a previous version, please make sure to read [UPGRADING](UPGRADING.md).
1432

15-
### API Client
33+
## API Client
1634

1735
Create an API client.
1836

@@ -85,7 +103,7 @@ api = Hyperclient.new('https://grape-with-roar.herokuapp.com/api')
85103
api.connection.use :http_cache
86104
```
87105

88-
### Resources and Attributes
106+
## Resources and Attributes
89107

90108
Hyperclient will fetch and discover the resources from your API.
91109

@@ -104,15 +122,15 @@ api.splines.each do |spline|
104122
end
105123
```
106124

107-
### Links and Embedded Resources
125+
## Links and Embedded Resources
108126

109127
The splines example above followed a link called "splines". While you can, you do not need to specify the HAL navigational structure, including links or embedded resources. Hyperclient will resolve these for you. If you prefer, you can explicitly navigate the link structure via `_links`. In the following example the "splines" link leads to a collection of embedded splines. Invoking `api.splines` is equivalent to `api._links.splines._embedded.splines`.
110128

111129
```ruby
112130
api._links.splines
113131
```
114132

115-
### Templated Links
133+
## Templated Links
116134

117135
Templated links require variables to be expanded. For example, the demo API has a link called "spline" that requires a spline "uuid".
118136

@@ -125,7 +143,7 @@ Invoking `api.spline(uuid: 'uuid').reticulated` is equivalent to `api._links.spl
125143

126144
The client is responsible for supplying all the necessary parameters. Templated links don't do any strict parameter name checking and don't support required vs. optional parameters. Parameters not declared by the API will be dropped and will not have any effect when passed to `_expand`.
127145

128-
### Curies
146+
## Curies
129147

130148
Curies are a suggested means by which to link documentation of a given resource. For example, the demo API contains very long links to images that use an "images" curie.
131149

@@ -134,7 +152,7 @@ puts spline['image:thumbnail'] # => https://grape-with-roar.herokuapp.com/api/sp
134152
puts spline.links._curies['image'].expand('thumbnail') # => /docs/images/thumbnail
135153
```
136154

137-
### Attributes
155+
## Attributes
138156

139157
Resource attributes can also be accessed as a hash.
140158

@@ -144,7 +162,7 @@ puts spline.to_h # => {"uuid" => "uuid", "reticulated" => true}
144162

145163
The above is equivalent to `spline._attributes.to_h`.
146164

147-
### HTTP
165+
## HTTP
148166

149167
Hyperclient uses [Faraday](http://github.com/lostisland/faraday) under the hood to perform HTTP calls. You can call any valid HTTP method on any resource.
150168

@@ -187,7 +205,7 @@ spline._delete
187205

188206
HTTP methods always return a new instance of Resource.
189207

190-
### Asynchronous requests
208+
## Asynchronous requests
191209

192210
By default, Hyperclient requests are performed asynchronously in a background thread pool via the [Futuroscope](https://github.com/codegram/futuroscope) gem. You can control the size of this pool by setting the `min_workers` and `max_workers` settings:
193211

@@ -204,7 +222,7 @@ api = Hyperclient.new('https://grape-with-roar.herokuapp.com/api') do |client|
204222
end
205223
```
206224

207-
## Testing Using Hyperclient
225+
# Testing Using Hyperclient
208226

209227
You can combine RSpec, Faraday::Adapter::Rack and Hyperclient to test your HAL API without having to ever examine the raw JSON response.
210228

@@ -233,14 +251,18 @@ end
233251

234252
For a complete example refer to [this Splines Demo API test](https://github.com/ruby-grape/grape-with-roar/blob/master/spec/api/splines_endpoint_with_hyperclient_spec.rb).
235253

236-
## Reference
254+
# Reference
237255

238256
[Hyperclient API Reference](http://rubydoc.org/github/codegram/hyperclient/master/frames).
239257

240-
## Contributing
258+
# Hyperclient Users
259+
260+
Using Hyperclient? Add your project to our wiki, please: <https://github.com/codegram/hyperclient/wiki>.
261+
262+
# Contributing
241263

242264
Hyperclient is work of [many people](https://github.com/codegram/hyperclient/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/codegram/hyperclient/pulls), [propose features and discuss issues](https://github.com/codegram/hyperclient/issues). See [CONTRIBUTING](CONTRIBUTING.md) for details.
243265

244-
## License
266+
# License
245267

246268
MIT License, see [LICENSE](LICENSE) for details. Copyright 2012-2014 [Codegram Technologies](http://codegram.com).

0 commit comments

Comments
 (0)