Skip to content

Commit 9ae4fa2

Browse files
committed
Adds syntax highlighting to README.md.
1 parent d4ccf34 commit 9ae4fa2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You will also need the 'Apple Worldwide Developer Relations Certification
1111
Authority' certificate and to conver the `.p12` files into `.pem` files. You
1212
can do both using the `node-passbook prepare-keys` command:
1313

14-
```
14+
```sh
1515
node-passbook prepare-keys -p keys
1616
```
1717

@@ -23,7 +23,7 @@ This is the same directory into which you placet the `.p12` files.
2323
Start with a template. A template has all the common data fields that will be
2424
shared between your passes, and also defines the keys to use for signing it.
2525

26-
```
26+
```js
2727
var createTemplate = require("passbook");
2828

2929
var template = createTemplate("coupon", {
@@ -38,7 +38,7 @@ second optional argument has any fields you want to set on the template.
3838

3939
You can access template fields directly, or from chained accessor methods, e.g:
4040

41-
```
41+
```js
4242
template.fields.passTypeIdentifier = "pass.com.example.passbook";
4343

4444
console.log(template.passTypeIdentifier());
@@ -58,7 +58,7 @@ Optional fields that you can set on the template (or pass): `backgroundColor`,
5858
In addition, you need to tell the template where to find the key files and where
5959
to load images from:
6060

61-
```
61+
```js
6262
template.keys("/etc/passbook/keys", "secret");
6363
template.loadImagesFrom("images");
6464
```
@@ -71,7 +71,7 @@ you may want to specify them once in the template.
7171

7272
To create a new pass from a template:
7373

74-
```
74+
```js
7575
var pass = template.createPass({
7676
serialNumber: "123456",
7777
description: "20% off"
@@ -81,7 +81,7 @@ var pass = template.createPass({
8181
Just like template, you can access pass fields directly, or from chained
8282
accessor methods, e.g:
8383

84-
```
84+
```js
8585
pass.fields.serialNumber = "12345";
8686
console.log(pass.serialNumber());
8787
pass.serialNumber("12345").
@@ -95,7 +95,7 @@ sigh.
9595
To make it easier, you can use methods like `add`, `get` and `remove` that
9696
will do the logical thing. For example, to add a primary field:
9797

98-
```
98+
```js
9999
pass.primaryFields.add("date", "Date", "Nov 1");
100100
pass.primaryFields.add({ key: "time", label: "Time", value: "10:00AM");
101101
```
@@ -104,21 +104,21 @@ You can also call `add` with an array of triplets or array of objects.
104104
105105
To get one or all fields:
106106
107-
```
107+
```js
108108
var dateField = pass.primaryFields.get("date");
109109
var allFields = pass.primaryFields.all();
110110
```
111111
112112
To remove one or all fields:
113113
114-
```
114+
```js
115115
pass.primaryFields.remove("date");
116116
pass.primaryFields.clear();
117117
```
118118
119119
Adding images to a pass is the same as adding images to a template:
120120
121-
```
121+
```js
122122
pass.images.icon = iconFilename;
123123
pass.icon(iconFilename);
124124
pass.loadImagesFrom("images");
@@ -134,7 +134,7 @@ and a buffer to its callback.
134134
135135
To generate a file:
136136
137-
```
137+
```js
138138
var file = fs.createWriteStream("mypass.pkpass");
139139
pass.on("error", function(error) {
140140
console.error(error);
@@ -151,7 +151,7 @@ You can pipe to any writeable stream. When working with HTTP, the `render`
151151
method will set the content type, pipe to the HTTP response, and make use of a
152152
callback (if supplied).
153153
154-
```
154+
```js
155155
server.get("/mypass", function(request, response) {
156156
pass.render(response, function(error) {
157157
if (error)

0 commit comments

Comments
 (0)