Content-Length: 849204 | pFad | http://github.com/SheetJS/js-codepage/commit/ff120df8f59f85a26e0673c1a2a3cab03bd0bf8c

B5 syntax highlighting in README [ci skip] · SheetJS/js-codepage@ff120df · GitHub
Skip to content

Commit ff120df

Browse files
committed
syntax highlighting in README [ci skip]
closes #13 (h/t @amilajack)
1 parent 5aacbbf commit ff120df

8 files changed

+91
-45
lines changed

README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,22 @@ which codepages are used.
1313

1414
In node:
1515

16-
var cptable = require('codepage');
16+
```js
17+
var cptable = require('codepage');
18+
```
1719

1820
In the browser:
1921

20-
<script src="cptable.js"></script>
21-
<script src="cputils.js"></script>
22+
```html
23+
<script src="cptable.js"></script>
24+
<script src="cputils.js"></script>
25+
```
2226

2327
Alternatively, use the full version in the dist folder:
2428

25-
<script src="cptable.full.js"></script>
29+
```html
30+
<script src="cptable.full.js"></script>
31+
```
2632

2733
The complete set of codepages is large due to some Double Byte Character Set
2834
encodings. A much smaller file that just includes SBCS codepages is provided in
@@ -32,12 +38,14 @@ If you know which codepages you need, you can include individual scripts for
3238
each codepage. The individual files are provided in the `bits/` directory.
3339
For example, to include only the Mac codepages:
3440

35-
<script src="bits/10000.js"></script>
36-
<script src="bits/10006.js"></script>
37-
<script src="bits/10007.js"></script>
38-
<script src="bits/10029.js"></script>
39-
<script src="bits/10079.js"></script>
40-
<script src="bits/10081.js"></script>
41+
```html
42+
<script src="bits/10000.js"></script>
43+
<script src="bits/10006.js"></script>
44+
<script src="bits/10007.js"></script>
45+
<script src="bits/10029.js"></script>
46+
<script src="bits/10079.js"></script>
47+
<script src="bits/10081.js"></script>
48+
```
4149

4250
All of the browser scripts define and append to the `cptable` object. To rename
4351
the object, edit the `JSVAR` shell variable in `make.sh` and run the script.
@@ -76,6 +84,9 @@ and returns a representation controlled by `ofmt`:
7684
- If `ofmt == 'str'`, return a String where `o.charCodeAt(i)` is the `i`-th byte
7785
- If `ofmt == 'arr'`, return an Array of bytes
7886

87+
`cptable.utils.decode(CP, data)` accepts a byte String or Array of numbers or
88+
Buffer and returns a JS string.
89+
7990
## Known Excel Codepages
8091

8192
A much smaller script, including only the codepages known to be used in Excel,
@@ -96,7 +107,7 @@ The `make.sh` script in the repo can take a manifest and generate JS source.
96107
Usage:
97108

98109
```bash
99-
bash make.sh path_to_manifest output_file_name JSVAR
110+
$ bash make.sh path_to_manifest output_file_name JSVAR
100111
```
101112

102113
where
@@ -107,7 +118,9 @@ where
107118

108119
The manifest file is expected to be a CSV with 3 columns:
109120

110-
<codepage number>,<source>,<size>
121+
```
122+
<codepage number>,<source>,<size>
123+
```
111124

112125
If a source is specified, it will try to download the specified file and parse.
113126
The file format is expected to follow the format from the unicode.org site.

misc/README.md.ascii

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,22 @@ which codepages are used.
1313

1414
In node:
1515

16-
var cptable = require('codepage');
16+
```js
17+
var cptable = require('codepage');
18+
```
1719

1820
In the browser:
1921

20-
<script src="cptable.js"></script>
21-
<script src="cputils.js"></script>
22+
```html
23+
<script src="cptable.js"></script>
24+
<script src="cputils.js"></script>
25+
```
2226

2327
Alternatively, use the full version in the dist folder:
2428

25-
<script src="cptable.full.js"></script>
29+
```html
30+
<script src="cptable.full.js"></script>
31+
```
2632

2733
The complete set of codepages is large due to some Double Byte Character Set
2834
encodings. A much smaller file that just includes SBCS codepages is provided in
@@ -32,12 +38,14 @@ If you know which codepages you need, you can include individual scripts for
3238
each codepage. The individual files are provided in the `bits/` directory.
3339
For example, to include only the Mac codepages:
3440

35-
<script src="bits/10000.js"></script>
36-
<script src="bits/10006.js"></script>
37-
<script src="bits/10007.js"></script>
38-
<script src="bits/10029.js"></script>
39-
<script src="bits/10079.js"></script>
40-
<script src="bits/10081.js"></script>
41+
```html
42+
<script src="bits/10000.js"></script>
43+
<script src="bits/10006.js"></script>
44+
<script src="bits/10007.js"></script>
45+
<script src="bits/10029.js"></script>
46+
<script src="bits/10079.js"></script>
47+
<script src="bits/10081.js"></script>
48+
```
4149

4250
All of the browser scripts define and append to the `cptable` object. To rename
4351
the object, edit the `JSVAR` shell variable in `make.sh` and run the script.
@@ -76,6 +84,9 @@ and returns a representation controlled by `ofmt`:
7684
- If `ofmt == 'str'`, return a String where `o.charCodeAt(i)` is the `i`-th byte
7785
- If `ofmt == 'arr'`, return an Array of bytes
7886

87+
`cptable.utils.decode(CP, data)` accepts a byte String or Array of numbers or
88+
Buffer and returns a JS string.
89+
7990
## Known Excel Codepages
8091

8192
A much smaller script, including only the codepages known to be used in Excel,
@@ -96,7 +107,7 @@ The `make.sh` script in the repo can take a manifest and generate JS source.
96107
Usage:
97108

98109
```bash
99-
bash make.sh path_to_manifest output_file_name JSVAR
110+
$ bash make.sh path_to_manifest output_file_name JSVAR
100111
```
101112

102113
where

misc/README.md.utf16be

240 Bytes
Binary file not shown.

misc/README.md.utf16le

240 Bytes
Binary file not shown.

misc/README.md.utf32be

480 Bytes
Binary file not shown.

misc/README.md.utf32le

480 Bytes
Binary file not shown.

misc/README.md.utf7

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,22 @@ which codepages are used.
1313

1414
In node:
1515

16-
var cptable +AD0 require('codepage')+ADs
16+
+AGAAYABg-js
17+
var cptable +AD0 require('codepage')+ADs
18+
+AGAAYABg
1719

1820
In the browser:
1921

20-
+ADw-script src+AD0AIg-cptable.js+ACIAPgA8-/script+AD4
21-
+ADw-script src+AD0AIg-cputils.js+ACIAPgA8-/script+AD4
22+
+AGAAYABg-html
23+
+ADw-script src+AD0AIg-cptable.js+ACIAPgA8-/script+AD4
24+
+ADw-script src+AD0AIg-cputils.js+ACIAPgA8-/script+AD4
25+
+AGAAYABg
2226

2327
Alternatively, use the full version in the dist folder:
2428

25-
+ADw-script src+AD0AIg-cptable.full.js+ACIAPgA8-/script+AD4
29+
+AGAAYABg-html
30+
+ADw-script src+AD0AIg-cptable.full.js+ACIAPgA8-/script+AD4
31+
+AGAAYABg
2632

2733
The complete set of codepages is large due to some Double Byte Character Set
2834
encodings. A much smaller file that just includes SBCS codepages is provided in
@@ -32,12 +38,14 @@ If you know which codepages you need, you can include individual scripts for
3238
each codepage. The individual files are provided in the +AGA-bits/+AGA directory.
3339
For example, to include only the Mac codepages:
3440

35-
+ADw-script src+AD0AIg-bits/10000.js+ACIAPgA8-/script+AD4
36-
+ADw-script src+AD0AIg-bits/10006.js+ACIAPgA8-/script+AD4
37-
+ADw-script src+AD0AIg-bits/10007.js+ACIAPgA8-/script+AD4
38-
+ADw-script src+AD0AIg-bits/10029.js+ACIAPgA8-/script+AD4
39-
+ADw-script src+AD0AIg-bits/10079.js+ACIAPgA8-/script+AD4
40-
+ADw-script src+AD0AIg-bits/10081.js+ACIAPgA8-/script+AD4
41+
+AGAAYABg-html
42+
+ADw-script src+AD0AIg-bits/10000.js+ACIAPgA8-/script+AD4
43+
+ADw-script src+AD0AIg-bits/10006.js+ACIAPgA8-/script+AD4
44+
+ADw-script src+AD0AIg-bits/10007.js+ACIAPgA8-/script+AD4
45+
+ADw-script src+AD0AIg-bits/10029.js+ACIAPgA8-/script+AD4
46+
+ADw-script src+AD0AIg-bits/10079.js+ACIAPgA8-/script+AD4
47+
+ADw-script src+AD0AIg-bits/10081.js+ACIAPgA8-/script+AD4
48+
+AGAAYABg
4149

4250
All of the browser scripts define and append to the +AGA-cptable+AGA object. To rename
4351
the object, edit the +AGA-JSVAR+AGA shell variable in +AGA-make.sh+AGA and run the script.
@@ -76,6 +84,9 @@ and returns a representation controlled by +AGA-ofmt+AGA:
7684
- If +AGA-ofmt +AD0APQ 'str'+AGA, return a String where +AGA-o.charCodeAt(i)+AGA is the +AGA-i+AGA--th byte
7785
- If +AGA-ofmt +AD0APQ 'arr'+AGA, return an Array of bytes
7886

87+
+AGA-cptable.utils.decode(CP, data)+AGA accepts a byte String or Array of numbers or
88+
Buffer and returns a JS string.
89+
7990
+ACMAIw Known Excel Codepages
8091

8192
A much smaller script, including only the codepages known to be used in Excel,
@@ -96,7 +107,7 @@ The +AGA-make.sh+AGA script in the repo can take a manifest and generate JS sour
96107
Usage:
97108

98109
+AGAAYABg-bash
99-
bash make.sh path+AF8-to+AF8-manifest output+AF8-file+AF8-name JSVAR
110+
+ACQ bash make.sh path+AF8-to+AF8-manifest output+AF8-file+AF8-name JSVAR
100111
+AGAAYABg
101112

102113
where

misc/README.md.utf8

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,22 @@ which codepages are used.
1313

1414
In node:
1515

16-
var cptable = require('codepage');
16+
```js
17+
var cptable = require('codepage');
18+
```
1719

1820
In the browser:
1921

20-
<script src="cptable.js"></script>
21-
<script src="cputils.js"></script>
22+
```html
23+
<script src="cptable.js"></script>
24+
<script src="cputils.js"></script>
25+
```
2226

2327
Alternatively, use the full version in the dist folder:
2428

25-
<script src="cptable.full.js"></script>
29+
```html
30+
<script src="cptable.full.js"></script>
31+
```
2632

2733
The complete set of codepages is large due to some Double Byte Character Set
2834
encodings. A much smaller file that just includes SBCS codepages is provided in
@@ -32,12 +38,14 @@ If you know which codepages you need, you can include individual scripts for
3238
each codepage. The individual files are provided in the `bits/` directory.
3339
For example, to include only the Mac codepages:
3440

35-
<script src="bits/10000.js"></script>
36-
<script src="bits/10006.js"></script>
37-
<script src="bits/10007.js"></script>
38-
<script src="bits/10029.js"></script>
39-
<script src="bits/10079.js"></script>
40-
<script src="bits/10081.js"></script>
41+
```html
42+
<script src="bits/10000.js"></script>
43+
<script src="bits/10006.js"></script>
44+
<script src="bits/10007.js"></script>
45+
<script src="bits/10029.js"></script>
46+
<script src="bits/10079.js"></script>
47+
<script src="bits/10081.js"></script>
48+
```
4149

4250
All of the browser scripts define and append to the `cptable` object. To rename
4351
the object, edit the `JSVAR` shell variable in `make.sh` and run the script.
@@ -76,6 +84,9 @@ and returns a representation controlled by `ofmt`:
7684
- If `ofmt == 'str'`, return a String where `o.charCodeAt(i)` is the `i`-th byte
7785
- If `ofmt == 'arr'`, return an Array of bytes
7886

87+
`cptable.utils.decode(CP, data)` accepts a byte String or Array of numbers or
88+
Buffer and returns a JS string.
89+
7990
## Known Excel Codepages
8091

8192
A much smaller script, including only the codepages known to be used in Excel,
@@ -96,7 +107,7 @@ The `make.sh` script in the repo can take a manifest and generate JS source.
96107
Usage:
97108

98109
```bash
99-
bash make.sh path_to_manifest output_file_name JSVAR
110+
$ bash make.sh path_to_manifest output_file_name JSVAR
100111
```
101112

102113
where

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/SheetJS/js-codepage/commit/ff120df8f59f85a26e0673c1a2a3cab03bd0bf8c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy