Skip to content

Commit 204a645

Browse files
committed
Clean up markdown in README file
1 parent 6b13dca commit 204a645

1 file changed

Lines changed: 64 additions & 63 deletions

File tree

README.md

Lines changed: 64 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ Examples:
7373
qrcode -o out.png "some text" Save as png image
7474
qrcode -d F00 -o out.png "some text" Use red as foreground color
7575
```
76-
If not specified, output type is guessed from file extension.<br>
76+
77+
If not specified, output type is guessed from file extension.
7778
Recognized extensions are `png`, `svg` and `txt`.
7879

7980
### Browser
@@ -167,7 +168,7 @@ const generateQR = async text => {
167168
Error correction capability allows to successfully scan a QR Code even if the symbol is dirty or damaged.
168169
Four levels are available to choose according to the operating environment.
169170

170-
Higher levels offer a better error resistance but reduce the symbol's capacity.<br>
171+
Higher levels offer a better error resistance but reduce the symbol's capacity.
171172
If the chances that the QR Code symbol may be corrupted are low (for example if it is showed through a monitor)
172173
is possible to safely use a low error level such as `Low` or `Medium`.
173174

@@ -182,7 +183,7 @@ Possible levels are shown below:
182183

183184
The percentage indicates the maximum amount of damaged surface after which the symbol becomes unreadable.
184185

185-
Error level can be set through `options.errorCorrectionLevel` property.<br>
186+
Error level can be set through `options.errorCorrectionLevel` property.
186187
If not specified, the default value is `M`.
187188

188189
```javascript
@@ -194,7 +195,7 @@ QRCode.toDataURL('some text', { errorCorrectionLevel: 'H' }, function (err, url)
194195
## QR Code capacity
195196
Capacity depends on symbol version and error correction level. Also encoding modes may influence the amount of storable data.
196197

197-
The QR Code versions range from version **1** to version **40**.<br>
198+
The QR Code versions range from version **1** to version **40**.
198199
Each version has a different number of modules (black and white dots), which define the symbol's size.
199200
For version 1 they are `21x21`, for version 2 `25x25` e so on.
200201
Higher is the version, more are the storable data, and of course bigger will be the QR Code symbol.
@@ -210,7 +211,7 @@ The table below shows the maximum number of storable characters in each encoding
210211

211212
**Note:** Maximum characters number can be different when using [Mixed modes](#mixed-modes).
212213

213-
QR Code version can be set through `options.version` property.<br>
214+
QR Code version can be set through `options.version` property.
214215
If no version is specified, the more suitable value will be used. Unless a specific version is required, this option is not needed.
215216

216217
```javascript
@@ -220,7 +221,7 @@ QRCode.toDataURL('some text', { version: 2 }, function (err, url) {
220221
```
221222

222223
## Encoding modes
223-
Modes can be used to encode a string in a more efficient way.<br>
224+
Modes can be used to encode a string in a more efficient way.
224225
A mode may be more suitable than others depending on the string content.
225226
A list of supported modes are shown in the table below:
226227

@@ -231,18 +232,18 @@ A list of supported modes are shown in the table below:
231232
| Kanji | Characters from the Shift JIS system based on JIS X 0208 | 2 kanji are represented by 13 bits |
232233
| Byte | Characters from the ISO/IEC 8859-1 character set | Each characters are represented by 8 bits |
233234

234-
Choose the right mode may be tricky if the input text is unknown.<br>
235-
In these cases **Byte** mode is the best choice since all characters can be encoded with it. (See [Multibyte characters](#multibyte-characters))<br>
235+
Choose the right mode may be tricky if the input text is unknown.
236+
In these cases **Byte** mode is the best choice since all characters can be encoded with it. (See [Multibyte characters](#multibyte-characters))
236237
However, if the QR Code reader supports mixed modes, using [Auto mode](#auto-mode) may produce better results.
237238

238239
### Mixed modes
239-
Mixed modes are also possible. A QR code can be generated from a series of segments having different encoding modes to optimize the data compression.<br>
240+
Mixed modes are also possible. A QR code can be generated from a series of segments having different encoding modes to optimize the data compression.
240241
However, switching from a mode to another has a cost which may lead to a worst result if it's not taken into account.
241242
See [Manual mode](#manual-mode) for an example of how to specify segments with different encoding modes.
242243

243244
### Auto mode
244-
By **default**, automatic mode selection is used.<br>
245-
The input string is automatically splitted in various segments optimized to produce the shortest possible bitstream using mixed modes.<br>
245+
By **default**, automatic mode selection is used.
246+
The input string is automatically splitted in various segments optimized to produce the shortest possible bitstream using mixed modes.
246247
This is the preferred way to generate the QR Code.
247248

248249
For example, the string **ABCDE12345678?A1A** will be splitted in 3 segments with the following modes:
@@ -253,12 +254,12 @@ For example, the string **ABCDE12345678?A1A** will be splitted in 3 segments wit
253254
| 12345678 | Numeric |
254255
| ?A1A | Byte |
255256

256-
Any other combinations of segments and modes will result in a longer bitstream.<br>
257+
Any other combinations of segments and modes will result in a longer bitstream.
257258
If you need to keep the QR Code size small, this mode will produce the best results.
258259

259260
### Manual mode
260261
If auto mode doesn't work for you or you have specific needs, is also possible to manually specify each segment with the relative mode.
261-
In this way no segment optimizations will be applied under the hood.<br>
262+
In this way no segment optimizations will be applied under the hood.
262263
Segments list can be passed as an array of object:
263264

264265
```javascript
@@ -275,8 +276,8 @@ Segments list can be passed as an array of object:
275276
```
276277

277278
### Kanji mode
278-
With kanji mode is possible to encode characters from the Shift JIS system in an optimized way.<br>
279-
Unfortunately, there isn't a way to calculate a Shifted JIS values from, for example, a character encoded in UTF-8, for this reason a conversion table from the input characters to the SJIS values is needed.<br>
279+
With kanji mode is possible to encode characters from the Shift JIS system in an optimized way.
280+
Unfortunately, there isn't a way to calculate a Shifted JIS values from, for example, a character encoded in UTF-8, for this reason a conversion table from the input characters to the SJIS values is needed.
280281
This table is not included by default in the bundle to keep the size as small as possible.
281282

282283
If your application requires kanji support, you will need to pass a function that will take care of converting the input characters to appropriate values.
@@ -402,11 +403,11 @@ Type: `Object`
402403
}
403404
```
404405

405-
<br>
406+
406407

407408
#### `toCanvas(canvasElement, text, [options], [cb(error)])`
408409
#### `toCanvas(text, [options], [cb(error, canvas)])`
409-
Draws qr code symbol to canvas.<br>
410+
Draws qr code symbol to canvas.
410411
If `canvasElement` is omitted a new canvas is returned.
411412

412413
##### `canvasElement`
@@ -437,11 +438,11 @@ QRCode.toCanvas('text', { errorCorrectionLevel: 'H' }, function (err, canvas) {
437438
})
438439
```
439440

440-
<br>
441+
441442

442443
#### `toDataURL(text, [options], [cb(error, url)])`
443444
#### `toDataURL(canvasElement, text, [options], [cb(error, url)])`
444-
Returns a Data URI containing a representation of the QR Code image.<br>
445+
Returns a Data URI containing a representation of the QR Code image.
445446
If provided, `canvasElement` will be used as canvas to generate the data URI.
446447

447448
##### `canvasElement`
@@ -456,14 +457,14 @@ Text to encode or a list of objects describing segments.
456457

457458
##### `options`
458459
- ###### `type`
459-
Type: `String`<br>
460+
Type: `String`
460461
Default: `image/png`
461462

462-
Data URI format.<br>
463-
Possible values are: `image/png`, `image/jpeg`, `image/webp`.<br>
463+
Data URI format.
464+
Possible values are: `image/png`, `image/jpeg`, `image/webp`.
464465

465466
- ###### `rendererOpts.quality`
466-
Type: `Number`<br>
467+
Type: `Number`
467468
Default: `0.92`
468469

469470
A Number between `0` and `1` indicating image quality if the requested type is `image/jpeg` or `image/webp`.
@@ -495,11 +496,11 @@ QRCode.toDataURL('text', opts, function (err, url) {
495496
img.src = url
496497
})
497498
```
498-
<br>
499+
499500

500501
#### `toString(text, [options], [cb(error, string)])`
501502

502-
Returns a string representation of the QR Code.<br>
503+
Returns a string representation of the QR Code.
503504

504505

505506
##### `text`
@@ -509,10 +510,10 @@ Text to encode or a list of objects describing segments.
509510

510511
##### `options`
511512
- ###### `type`
512-
Type: `String`<br>
513+
Type: `String`
513514
Default: `utf8`
514515

515-
Output format.<br>
516+
Output format.
516517
Possible values are: `terminal`,`utf8`, and `svg`.
517518

518519
See [Options](#options) for other settings.
@@ -530,14 +531,14 @@ QRCode.toString('http://www.google.com', function (err, string) {
530531
})
531532
```
532533

533-
<br>
534+
534535

535536

536537
### Server API
537538
#### `create(text, [options])`
538539
See [create](#createtext-options).
539540

540-
<br>
541+
541542

542543
#### `toCanvas(canvas, text, [options], [cb(error)])`
543544
Draws qr code symbol to [node canvas](https://github.com/Automattic/node-canvas).
@@ -555,10 +556,10 @@ Type: `Function`
555556

556557
Callback function called on finish.
557558

558-
<br>
559+
559560

560561
#### `toDataURL(text, [options], [cb(error, url)])`
561-
Returns a Data URI containing a representation of the QR Code image.<br>
562+
Returns a Data URI containing a representation of the QR Code image.
562563
Only works with `image/png` type for now.
563564

564565
##### `text`
@@ -574,10 +575,10 @@ Type: `Function`
574575

575576
Callback function called on finish.
576577

577-
<br>
578+
578579

579580
#### `toString(text, [options], [cb(error, string)])`
580-
Returns a string representation of the QR Code.<br>
581+
Returns a string representation of the QR Code.
581582
If choosen output format is `svg` it will returns a string containing xml code.
582583

583584
##### `text`
@@ -587,10 +588,10 @@ Text to encode or a list of objects describing segments.
587588

588589
##### `options`
589590
- ###### `type`
590-
Type: `String`<br>
591+
Type: `String`
591592
Default: `utf8`
592593

593-
Output format.<br>
594+
Output format.
594595
Possible values are: `utf8`, `svg`, `terminal`.
595596

596597
See [Options](#options) for other settings.
@@ -608,11 +609,11 @@ QRCode.toString('http://www.google.com', function (err, string) {
608609
})
609610
```
610611

611-
<br>
612+
612613

613614
#### `toFile(path, text, [options], [cb(error)])`
614-
Saves QR Code to image file.<br>
615-
If `options.type` is not specified, the format will be guessed from file extension.<br>
615+
Saves QR Code to image file.
616+
If `options.type` is not specified, the format will be guessed from file extension.
616617
Recognized extensions are `png`, `svg`, `txt`.
617618

618619
##### `path`
@@ -627,20 +628,20 @@ Text to encode or a list of objects describing segments.
627628

628629
##### `options`
629630
- ###### `type`
630-
Type: `String`<br>
631+
Type: `String`
631632
Default: `png`
632633

633-
Output format.<br>
634+
Output format.
634635
Possible values are: `png`, `svg`, `utf8`.
635636

636637
- ###### `rendererOpts.deflateLevel` **(png only)**
637-
Type: `Number`<br>
638+
Type: `Number`
638639
Default: `9`
639640

640641
Compression level for deflate.
641642

642643
- ###### `rendererOpts.deflateStrategy` **(png only)**
643-
Type: `Number`<br>
644+
Type: `Number`
644645
Default: `3`
645646

646647
Compression strategy for deflate.
@@ -665,7 +666,7 @@ QRCode.toFile('path/to/filename.png', 'Some text', {
665666
})
666667
```
667668

668-
<br>
669+
669670

670671
#### `toFileStream(stream, text, [options])`
671672
Writes QR Code image to stream. Only works with `png` format for now.
@@ -683,76 +684,76 @@ Text to encode or a list of objects describing segments.
683684
##### `options`
684685
See [Options](#options).
685686

686-
<br>
687+
687688

688689
### Options
689690

690691
#### QR Code options
691692
##### `version`
692-
Type: `Number`<br>
693+
Type: `Number`
693694

694695
QR Code version. If not specified the more suitable value will be calculated.
695696

696697
##### `errorCorrectionLevel`
697-
Type: `String`<br>
698+
Type: `String`
698699
Default: `M`
699700

700-
Error correction level.<br>
701+
Error correction level.
701702
Possible values are `low, medium, quartile, high` or `L, M, Q, H`.
702703

703704
##### `maskPattern`
704-
Type: `Number`<br>
705+
Type: `Number`
705706

706-
Mask pattern used to mask the symbol.<br>
707-
Possible values are `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`.<br>
707+
Mask pattern used to mask the symbol.
708+
Possible values are `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`.
708709
If not specified the more suitable value will be calculated.
709710

710711
##### `toSJISFunc`
711-
Type: `Function`<br>
712+
Type: `Function`
712713

713-
Helper function used internally to convert a kanji to its Shift JIS value.<br>
714+
Helper function used internally to convert a kanji to its Shift JIS value.
714715
Provide this function if you need support for Kanji mode.
715716

716717
#### Renderers options
717718
##### `margin`
718-
Type: `Number`<br>
719+
Type: `Number`
719720
Default: `4`
720721

721722
Define how much wide the quiet zone should be.
722723

723724
##### `scale`
724-
Type: `Number`<br>
725+
Type: `Number`
725726
Default: `4`
726727

727728
Scale factor. A value of `1` means 1px per modules (black dots).
728729

729730
##### `small`
730-
Type: `Boolean`<br>
731+
Type: `Boolean`
731732
Default: `false`
732733

733734
Relevant only for terminal renderer. Outputs smaller QR code.
734735

735736
##### `width`
736-
Type: `Number`<br>
737+
Type: `Number`
737738

738-
Forces a specific width for the output image.<br>
739-
If width is too small to contain the qr symbol, this option will be ignored.<br>
739+
Forces a specific width for the output image.
740+
If width is too small to contain the qr symbol, this option will be ignored.
740741
Takes precedence over `scale`.
741742

742743
##### `color.dark`
743-
Type: `String`<br>
744+
Type: `String`
744745
Default: `#000000ff`
745746

746-
Color of dark module. Value must be in hex format (RGBA).<br>
747+
Color of dark module. Value must be in hex format (RGBA).
747748
Note: dark color should always be darker than `color.light`.
748749

749750
##### `color.light`
750-
Type: `String`<br>
751+
Type: `String`
751752
Default: `#ffffffff`
752753

753-
Color of light module. Value must be in hex format (RGBA).<br>
754+
Color of light module. Value must be in hex format (RGBA).
754755

755-
<br>
756+
756757

757758
## GS1 QR Codes
758759
There was a real good discussion here about them. but in short any qrcode generator will make gs1 compatible qrcodes, but what defines a gs1 qrcode is a header with metadata that describes your gs1 information.

0 commit comments

Comments
 (0)