Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit a2d0451

Browse files
committed
Add missing readme - NPM publish action requires it
1 parent 4642a8b commit a2d0451

2 files changed

Lines changed: 36 additions & 31 deletions

File tree

README.rst renamed to README.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
embedly
2-
-------
2+
=======
33

44
Embedly node client library. To find out what Embedly is all about, please
55
visit http://embed.ly.
66

7-
News
8-
^^^^
7+
# News
8+
99

1010
* 05/04/2016 - The callback on object creation has been removed. Initialization
1111
is now lazy and happens on the first API call. This is a breaking change if you
1212
used a callback style constructor.
1313
* The embedly-node modules has been updated and simplified. It is not backward
1414
compatible. If you want to stick with the old API, use a verion < 1.0.
1515

16-
Prerequisites
17-
^^^^^^^^^^^^^
16+
# Prerequisites
17+
1818

1919
* nodejs - Available in most package managers
2020
* `npm <http://npmjs.org/>`_
2121

2222

23-
Installing
24-
^^^^^^^^^^
23+
# Installing
24+
2525

2626
To install the official latest stable version, please use npm::
2727

@@ -33,11 +33,11 @@ If you would like cutting edge, then you can clone and install HEAD::
3333
cd embedly-node
3434
npm install
3535

36-
Getting Started
37-
^^^^^^^^^^^^^^^
36+
# Getting Started
3837

3938
Here are some examples *hint* replace xxxxxxxxxxx with real key::
4039

40+
```js
4141
var EMBEDLY_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxx';
4242

4343
var embedly = require('embedly'),
@@ -89,26 +89,27 @@ Here are some examples *hint* replace xxxxxxxxxxx with real key::
8989
console.log('3. ');
9090
console.log(util.inspect(objs[0]));
9191
});
92+
```
93+
94+
# Authentication
9295

93-
Authentication
94-
^^^^^^^^^^^^^^
9596

9697
If a key is not specified, the EMBEDLY_KEY environmental variable will be
9798
used. You can signup for an Embedly key at http://embed.ly. Support for
9899
oauth will be added in a future version of the library.
99100

100-
Creating an api object
101-
^^^^^^^^^^^^^^^^^^^^^^
101+
# Creating an api object
102+
102103

103104
The embedly exported prototype function takes an `Object` of optional
104105
parameters to configure the Embedly API.
105106

106-
:key: Your Embedly consumer key.
107-
:proto: The protocol to use when calling Embedly. The default is `http`.
107+
`:key`: Your Embedly consumer key.
108+
`:proto`: The protocol to use when calling Embedly. The default is `http`.
108109
`https` is also valid.
109-
:logger: An `Object` that has prototype functions `error` `warn` and `debug`
110+
`:logger`: An `Object` that has prototype functions `error` `warn` and `debug`
110111
that can be invoked with a single string argument.
111-
:servicesRegexp: A regular expression object to match urls against before
112+
`:servicesRegexp`: A regular expression object to match urls against before
112113
sending to the embedly API. Urls sent to an endpoint
113114
that don't match will be returned as 401 errors.
114115

@@ -117,8 +118,8 @@ parameter. It is possible in certain circumstances that the embedly api
117118
will fail to initialize properly. Therefore it is recommended to use the
118119
callback function and check for errors, like the example code above.
119120

120-
Endpoints
121-
^^^^^^^^^
121+
# Endpoints
122+
122123

123124
Embedly api endpoints are implemented as prototype functions on the api object.
124125
There are two endpoints implemented. See the Embedly API documentation for more
@@ -133,11 +134,12 @@ to canonize the parameters before sending them. Sending more than 20 URLs at
133134
a time will fail. Future version of this library will batch requests of more
134135
than 20 URLs into batches whose size will be configurable.
135136

136-
Logging
137-
^^^^^^^
137+
# Logging
138+
138139

139140
`embedly-node` does provide some minimal logging to help diagnose problems. By default, a `winston` console logger with log level `error` will be created, but only if winston is installed. If you'd like more control over logging, you can create your own logger and pass it into embedly on instantiation. ex::
140141

142+
```js
141143
var embedly = require('embedly'),
142144
winston = require('winston'),
143145
logger = new (winston.Logger)({
@@ -147,9 +149,10 @@ Logging
147149
new embedly({logger: logger}, function(err, api) {
148150
// do stuff with api
149151
});
152+
```
153+
154+
# Testing
150155

151-
Testing
152-
^^^^^^^
153156

154157
We have provided some commandline tools to test the Embedly interface.
155158

@@ -159,21 +162,23 @@ We have provided some commandline tools to test the Embedly interface.
159162
Using --help with the commands should give you a good idea of how to use them.
160163

161164

162-
Develop
163-
^^^^^^^
165+
# Develop
164166

165167
Run tests::
166168

167-
npm test
169+
```bash
170+
year test
171+
```
168172

169173
Some tests will fail due to missing api key. Set the EMBEDLY_KEY environmental
170174
variable with your key to get them to pass::
171175

176+
```
172177
EMBEDLY_KEY=xxxxxxxxxxxxx npm test
178+
```
173179

180+
# Note on Patches/Pull Requests
174181

175-
Note on Patches/Pull Requests
176-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177182

178183
* Fork the project.
179184
* Make your feature addition or bug fix.
@@ -183,7 +188,7 @@ Note on Patches/Pull Requests
183188
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
184189
* Send me a pull request. Bonus points for topic branches.
185190

186-
Copyright
187-
^^^^^^^^^
191+
# Copyright
192+
188193

189194
Copyright (c) 2011 Embed.ly, Inc. See MIT-LICENSE for details.

tools/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ main() {
1111
rm -Rf dist/
1212
mkdir -p dist/
1313
mocha
14-
cp -r index.js LICENSE bin/ dist/
14+
cp -r index.js LICENSE README.md bin/ dist/
1515
}
1616

1717
main "$@"

0 commit comments

Comments
 (0)