Edited API page markdown to conform to Github markdown parsing

This commit is contained in:
alexandercerutti
2018-09-13 01:29:47 +02:00
parent 0deb4861ff
commit 9de4a7a9ee

81
API.md
View File

@@ -31,33 +31,33 @@ ___
### Index: ### Index:
* [Instance](#method:constructor) * [Instance](#method_constructor)
* Localize the pass * Localize the pass
* [.localize()](#method:localize) * [.localize()](#method_localize)
* Setting barcode * Setting barcode
* [.barcode()](#method:barcode) * [.barcode()](#method_barcode)
* [.backward()](#method:bBackward) * [.backward()](#method_bBackward)
* [.autocomplete()](#method:bAutocomplete) * [.autocomplete()](#method_bAutocomplete)
* Setting expiration / voiding the pass * Setting expiration / voiding the pass
* [.expiration()](#method:expiration) * [.expiration()](#method_expiration)
* [.void()](#method:void) * [.void()](#method_void)
* Setting relevance * Setting relevance
* [.relevance()](#method:relevance) * [.relevance()](#method_relevance)
* Setting NFC * Setting NFC
* [.nfc()](#method:nfc) * [.nfc()](#method_nfc)
* Setting Pass Structure Keys (primaryFields, secondaryFields, ...) * Setting Pass Structure Keys (primaryFields, secondaryFields, ...)
* [<field>.push()](#prop:fields-push) * [<field>.push()](#prop_fields-push)
* [<field>.pop()](#prop:fields-pop) * [<field>.pop()](#prop_fields-pop)
* [TransitType](#prop:transitType) * [TransitType](#prop_transitType)
* Generating the compiled pass. * Generating the compiled pass.
* [.generate()](#method:generate) * [.generate()](#method_generate)
<br><br> <br><br>
___ ___
<a name="method:constructor"> <a name="method_constructor"></a>
#### constructor() #### constructor()
</a>
```javascript ```javascript
var pass = new Pass(options); var pass = new Pass(options);
@@ -96,9 +96,9 @@ The only differences stands in the way the only method below is used and how the
> If you are designing your pass for a language only, you can directly replace the placeholders in `pass.json` with translation. > If you are designing your pass for a language only, you can directly replace the placeholders in `pass.json` with translation.
<br> <br>
<a name="method:localize"> <a name="method_localize"></a>
#### .localize() #### .localize()
</a>
```javascript ```javascript
pass.localize(lang, options); pass.localize(lang, options);
@@ -144,9 +144,9 @@ ___
**Setting barcodes**: **Setting barcodes**:
___ ___
<a name="method:barcode"> <a name="method_barcode"></a>
#### .barcode() #### .barcode()
</a>
```javascript ```javascript
pass.barcode(data); pass.barcode(data);
@@ -204,9 +204,9 @@ To support versions prior to iOS 9, `barcode` key is automatically supported as
**See**: [PassKit Package Format Reference # Barcode Dictionary](https://apple.co/2myAbst) **See**: [PassKit Package Format Reference # Barcode Dictionary](https://apple.co/2myAbst)
<br> <br>
<a name="method:bBackward"> <a name="method_bBackward"></a>
#### .barcode().backward() #### .barcode().backward()
</a>
```javascript ```javascript
pass.barcode(data).backward(format); pass.barcode(data).backward(format);
@@ -242,9 +242,9 @@ pass
``` ```
<br> <br>
<a name="method:bAutocomplete"> <a name="method_bAutocomplete"></a>
#### .barcode().autocomplete() #### .barcode().autocomplete()
</a>
```javascript ```javascript
pass.barcode(data).autocomplete(); pass.barcode(data).autocomplete();
@@ -264,9 +264,9 @@ ___
**Setting expiration / void the pass**: **Setting expiration / void the pass**:
___ ___
<a name="method:expiration"> <a name="method_expiration"></a>
#### .expiration() #### .expiration()
</a>
```javascript ```javascript
pass.expiration(date [, format]); pass.expiration(date [, format]);
@@ -295,9 +295,10 @@ If the parsing fails, the error will be emitted only in debug mode and the prope
| date | String/date | The date on which the pass will expire | false | - | date | String/date | The date on which the pass will expire | false | -
| format | String | A custom format to be used to parse the date | true | undefined | format | String | A custom format to be used to parse the date | true | undefined
<a name="method:void"> <a name="method_void"></a>
#### .void() #### .void()
</a>
```javascript ```javascript
pass.void(); pass.void();
``` ```
@@ -316,9 +317,9 @@ ___
**Setting relevance**: **Setting relevance**:
___ ___
<a name="method:relevance"> <a name="method_relevance"></a>
#### .relevance() #### .relevance()
</a>
```javascript ```javascript
pass.relevance(key, value [, relevanceDateFormat]); pass.relevance(key, value [, relevanceDateFormat]);
@@ -335,7 +336,7 @@ See [Apple Documentation dedicated page](https://apple.co/2QiE9Ds) for more.
For the first two keys, the argument 'value' (which will be of type **Array\<Object>**) will be checked and filtered against a schema (one for type). For the first two keys, the argument 'value' (which will be of type **Array\<Object>**) will be checked and filtered against a schema (one for type).
For *relevantDate*, the date is parsed in the same formats of [#expiration()](#method:expiration). For *maxDistance*, the value is simply converted as Number and pushed only with successful conversion. For *relevantDate*, the date is parsed in the same formats of [#expiration()](#method_expiration). For *maxDistance*, the value is simply converted as Number and pushed only with successful conversion.
**Arguments**: **Arguments**:
@@ -369,9 +370,9 @@ ___
**NFC Support**: **NFC Support**:
___ ___
<a name="method:nfc"> <a name="method_nfc"></a>
#### .nfc() #### .nfc()
</a>
```javascript ```javascript
pass.nfc([data, ...]) pass.nfc([data, ...])
@@ -406,9 +407,9 @@ Unlike method-set properties or overrides, to set fields inside areas (*primaryF
<br> <br>
<a name="prop:fields-push"> <a name="prop_fields-push"></a>
#### <field>.push() #### <field>.push()
</a>
```javascript ```javascript
pass.<field>.push(...fields); pass.<field>.push(...fields);
@@ -461,9 +462,9 @@ pass.primaryFields.push({
<br> <br>
<a name="prop:fields-pop"> <a name="prop_fields-pop"></a>
#### <field>.pop() #### <field>.pop()
</a>
```javascript ```javascript
pass.<field>.pop(amount); pass.<field>.pop(amount);
@@ -494,9 +495,9 @@ pass.backFields.pop(5); // last five elements are popped out.
<br> <br>
<a name="prop:transitType"> <a name="prop_transitType"></a>
#### .transitType #### .transitType
</a>
```javascript ```javascript
pass.transitType = "PKTransitTypeAir"; pass.transitType = "PKTransitTypeAir";
@@ -518,9 +519,9 @@ As you can see in [examples folder](/examples), to send a .pkpass file, a basic
<br> <br>
<a name="method:generate"> <a name="method_generate"></a>
#### .generate() #### .generate()
</a>
```javascript ```javascript
pass.generate(); pass.generate();