taraskevizer 0.0.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +99 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,99 @@
1
+ ## Install
2
+
3
+ ```
4
+ $ npm i taraskevizer
5
+ ```
6
+
7
+
8
+ ## Usage
9
+
10
+ ```js
11
+ import { taraskSync, tarask } from 'taraskevizer';
12
+
13
+ const result = taraskSync(text);
14
+ // or
15
+ const result = await tarask(text);
16
+ ```
17
+
18
+ ## API
19
+
20
+ ### tarask(text, options?)
21
+ Returns a `Promise<string>`
22
+
23
+ ### taraskSync(text, options?)
24
+ Returns a `string`
25
+
26
+ #### text
27
+ Type: `string`
28
+
29
+ ## Options
30
+ Type: `object`
31
+
32
+ ### abc
33
+ Type: `number`
34
+
35
+ Default value: `0`
36
+
37
+ Alphabet of output text:
38
+ 0. cyrillic
39
+ 1. latin
40
+ 2. arabic
41
+
42
+ ### j
43
+ Type: `number`
44
+
45
+ Default value: `0`
46
+
47
+ When to replace `і`(`i`) by `й`(`j`) after vowels:
48
+ 0. never
49
+ 1. random
50
+ 2. always
51
+
52
+ ### html
53
+ Type: `false|object`
54
+
55
+ Default value: `false`
56
+
57
+ If `object`, some parts of a text are wrapped in HTML tags.
58
+
59
+ #### g
60
+ Type: `boolean`
61
+
62
+ Default value: `false`
63
+
64
+ Do replace `г`(`h`) by `ґ`(`g`) in cyrillic alphabet?
65
+ ```html
66
+ false: <tarH>г</tarH> <tarH>Г</tarH>
67
+ true: <tarH>ґ</tarH> <tarH>Ґ</tarH>
68
+ ```
69
+
70
+ ## HTML tags
71
+
72
+ ### tarF
73
+ Difference between an input and an output word.
74
+
75
+ ```html
76
+ <tarF>this_part_of_word_is_fixed</tarF>
77
+
78
+ пл<tarF>я</tarF>н
79
+ ```
80
+
81
+ ### tarL
82
+ A part of a word wrapped in this tag is variable,
83
+ variations are mentioned in a `data-l` attribute
84
+ and are separated by commas
85
+
86
+ ```html
87
+ <tarL data-l="variation2,variation3">variation1</tarL>
88
+
89
+ <tarL data-l="Горадня">Гродна</tarL>
90
+ ```
91
+
92
+ ### tarH
93
+ Can be replaced by `ґ`(`g`) letter. appears only if alphabet is cyrillic
94
+
95
+ ```html
96
+ <tarH>г</tarH>
97
+
98
+ <tarH>Г</tarH>валт
99
+ ```
package/package.json CHANGED
@@ -2,14 +2,15 @@
2
2
  "name": "taraskevizer",
3
3
  "author": "GooseOb",
4
4
  "license": "MIT",
5
- "version": "0.0.3",
5
+ "version": "1.0.0",
6
6
  "private": false,
7
7
  "homepage": "https://gooseob.github.io/taraskevizatar/",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",
10
10
  "types": "dist/index.d.ts",
11
11
  "files": [
12
- "dist/**/*"
12
+ "dist/**/*",
13
+ "README.md"
13
14
  ],
14
15
  "scripts": {
15
16
  "build": "tsup --config build-config/index.js"