polytypo 1.1.0 → 1.3.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.
- checksums.yaml +4 -4
- data/README.md +33 -1
- data/lib/polytypo/data/VERSION +1 -1
- data/lib/polytypo/data/fixtures/cs.json +161 -0
- data/lib/polytypo/data/fixtures/de-CH.json +9 -1
- data/lib/polytypo/data/fixtures/de-DE.json +227 -6
- data/lib/polytypo/data/fixtures/el.json +9 -1
- data/lib/polytypo/data/fixtures/en-GB.json +28 -1
- data/lib/polytypo/data/fixtures/en-US.json +690 -1
- data/lib/polytypo/data/fixtures/es.json +193 -0
- data/lib/polytypo/data/fixtures/fi.json +9 -1
- data/lib/polytypo/data/fixtures/fr-CA.json +50 -1
- data/lib/polytypo/data/fixtures/fr.json +282 -1
- data/lib/polytypo/data/fixtures/it.json +161 -0
- data/lib/polytypo/data/fixtures/locale-resolution.json +76 -4
- data/lib/polytypo/data/fixtures/nl.json +121 -0
- data/lib/polytypo/data/fixtures/pl.json +137 -0
- data/lib/polytypo/data/fixtures/pt-BR.json +156 -0
- data/lib/polytypo/data/fixtures/pt-PT.json +156 -0
- data/lib/polytypo/data/fixtures/ru.json +47 -1
- data/lib/polytypo/data/fixtures/sv.json +9 -1
- data/lib/polytypo/data/fixtures/uk.json +153 -0
- data/lib/polytypo/data/locales/cs.json +90 -0
- data/lib/polytypo/data/locales/de-DE.json +7 -2
- data/lib/polytypo/data/locales/en-US.json +3 -3
- data/lib/polytypo/data/locales/es.json +111 -0
- data/lib/polytypo/data/locales/fr-CA.json +7 -1
- data/lib/polytypo/data/locales/fr.json +7 -1
- data/lib/polytypo/data/locales/it.json +95 -0
- data/lib/polytypo/data/locales/nl.json +84 -0
- data/lib/polytypo/data/locales/pl.json +96 -0
- data/lib/polytypo/data/locales/pt-BR.json +82 -0
- data/lib/polytypo/data/locales/pt-PT.json +84 -0
- data/lib/polytypo/data/locales/registry.json +23 -3
- data/lib/polytypo/data/locales/ru.json +2 -2
- data/lib/polytypo/data/locales/uk.json +130 -0
- data/lib/polytypo/data/rules/analyze.md +157 -0
- data/lib/polytypo/data/rules/apostrophe.md +432 -0
- data/lib/polytypo/data/rules/dashes.md +128 -37
- data/lib/polytypo/data/rules/ellipsis.md +271 -0
- data/lib/polytypo/data/rules/hyphen.md +353 -0
- data/lib/polytypo/data/rules/locale-resolution.md +239 -0
- data/lib/polytypo/data/rules/modes.md +1281 -0
- data/lib/polytypo/data/rules/nbsp.md +1157 -0
- data/lib/polytypo/data/rules/order.json +11 -11
- data/lib/polytypo/data/rules/pipeline-idempotency.md +605 -0
- data/lib/polytypo/data/rules/quotes.md +1324 -0
- data/lib/polytypo/data/rules/ranges.md +489 -0
- data/lib/polytypo/data/rules/spaces.md +649 -0
- data/lib/polytypo/data/rules/symbols.md +540 -0
- data/lib/polytypo/data/schema/fixtures.schema.json +18 -3
- data/lib/polytypo/engine/origin.rb +75 -0
- data/lib/polytypo/engine/pipeline.rb +72 -1
- data/lib/polytypo/engine/rules/apostrophe.rb +10 -1
- data/lib/polytypo/engine/rules/dash_shared.rb +85 -3
- data/lib/polytypo/engine/rules/dashes.rb +4 -1
- data/lib/polytypo/engine/rules/nbsp.rb +53 -20
- data/lib/polytypo/engine/rules/ranges.rb +24 -20
- data/lib/polytypo/engine/rules/spaces.rb +8 -1
- data/lib/polytypo/errors.rb +3 -0
- data/lib/polytypo/modes/runner.rb +17 -0
- data/lib/polytypo/modes/spans.rb +30 -2
- data/lib/polytypo/modes/yaml.rb +312 -0
- data/lib/polytypo/version.rb +1 -1
- data/lib/polytypo.rb +126 -15
- metadata +31 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"spec": "1.
|
|
2
|
+
"spec": "1.3.0",
|
|
3
3
|
"$comment": "Single source of truth for pipeline order. Rules run in ascending `order`. Disabling a rule removes it from the sequence and never reorders the rest. Rule ids are public API (see docs/ARCHITECTURE.md section 5). \"spec\" here must track spec/VERSION exactly — it is not itself the global version source; scripts/validate-spec.mjs enforces the match.",
|
|
4
4
|
"rules": [
|
|
5
5
|
{
|
|
6
6
|
"id": "spaces",
|
|
7
7
|
"order": 10,
|
|
8
8
|
"default": "on",
|
|
9
|
-
"modes": ["text", "html", "markdown"],
|
|
9
|
+
"modes": ["text", "html", "markdown", "yaml"],
|
|
10
10
|
"localeData": [],
|
|
11
11
|
"summary": "Collapse repeated spaces, strip spaces before punctuation, normalize spacing inside brackets."
|
|
12
12
|
},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"id": "ellipsis",
|
|
15
15
|
"order": 20,
|
|
16
16
|
"default": "on",
|
|
17
|
-
"modes": ["text", "html", "markdown"],
|
|
17
|
+
"modes": ["text", "html", "markdown", "yaml"],
|
|
18
18
|
"localeData": ["ellipsis"],
|
|
19
19
|
"summary": "Three dots to U+2026; locale-dependent abbreviated forms after terminal punctuation."
|
|
20
20
|
},
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"id": "ranges",
|
|
23
23
|
"order": 25,
|
|
24
24
|
"default": "off",
|
|
25
|
-
"modes": ["text", "html", "markdown"],
|
|
25
|
+
"modes": ["text", "html", "markdown", "yaml"],
|
|
26
26
|
"localeData": ["dash"],
|
|
27
27
|
"summary": "Numeric/date range dash per locale convention (dash.range). Explicit opt-in (spec 0.5.0): a genuine range and a compound label sharing the same digit-hyphen-digit shape (`Figure 5-10`) cannot be told apart without the preceding word, which this project's rules are built never to consult. Off by default; enable with `{ rules: { ranges: true } }`."
|
|
28
28
|
},
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"id": "dashes",
|
|
31
31
|
"order": 30,
|
|
32
32
|
"default": "on",
|
|
33
|
-
"modes": ["text", "html", "markdown"],
|
|
33
|
+
"modes": ["text", "html", "markdown", "yaml"],
|
|
34
34
|
"localeData": ["dash"],
|
|
35
|
-
"summary": "Parenthetical dash per locale convention (dash.parenthetical). Never reinterprets a
|
|
35
|
+
"summary": "Parenthetical dash per locale convention (dash.parenthetical). Never reinterprets a range candidate as a parenthetical dash — that shape belongs to `ranges` alone, whether or not `ranges` is enabled (spec 0.5.0; range detection moved out of this rule). A candidate is digit-flanked, or flanked by a closed-up symbol matched on the opposite member (spec 1.3.0; ranges.md §3.2a)."
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"id": "hyphen",
|
|
39
39
|
"order": 35,
|
|
40
40
|
"default": "on",
|
|
41
|
-
"modes": ["text", "html", "markdown"],
|
|
41
|
+
"modes": ["text", "html", "markdown", "yaml"],
|
|
42
42
|
"localeData": ["hyphen"],
|
|
43
43
|
"summary": "Bind morphological hyphen forms with U+2011 (non-breaking hyphen) so they cannot be broken across lines. Runs after `dashes`, which has already declined every letter-adjacent hyphen. A no-op for locales whose hyphen lists are empty."
|
|
44
44
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"id": "quotes",
|
|
47
47
|
"order": 40,
|
|
48
48
|
"default": "on",
|
|
49
|
-
"modes": ["text", "html", "markdown"],
|
|
49
|
+
"modes": ["text", "html", "markdown", "yaml"],
|
|
50
50
|
"localeData": ["quotes"],
|
|
51
51
|
"summary": "Straight quotes to locale primary/secondary pairs with nesting resolution. Runs before `apostrophe` so that a straight apostrophe is still available as quote evidence. Declines to pair a medial single-quoted `n` (spec 1.1.0, every locale) or a span matching a cited `quotes.elisionIdioms` entry, so that `apostrophe` converts both marks instead."
|
|
52
52
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"id": "apostrophe",
|
|
55
55
|
"order": 50,
|
|
56
56
|
"default": "on",
|
|
57
|
-
"modes": ["text", "html", "markdown"],
|
|
57
|
+
"modes": ["text", "html", "markdown", "yaml"],
|
|
58
58
|
"localeData": [],
|
|
59
59
|
"summary": "Remaining straight apostrophes to U+2019 without corrupting contractions. Reads no locale data: spec 0.5.0's `quotes.elisionIdioms` lookup existed only for the preserve set withdrawn in spec 1.1.0, so every mark `quotes` declined to claim now reaches this rule's ordinary structural case ladder."
|
|
60
60
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"id": "symbols",
|
|
63
63
|
"order": 60,
|
|
64
64
|
"default": "on",
|
|
65
|
-
"modes": ["text", "html", "markdown"],
|
|
65
|
+
"modes": ["text", "html", "markdown", "yaml"],
|
|
66
66
|
"localeData": [],
|
|
67
67
|
"summary": "(c)/(r)/(tm) to the corresponding signs; multiplication sign between numerals."
|
|
68
68
|
},
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"id": "nbsp",
|
|
71
71
|
"order": 70,
|
|
72
72
|
"default": "on",
|
|
73
|
-
"modes": ["text", "html", "markdown"],
|
|
73
|
+
"modes": ["text", "html", "markdown", "yaml"],
|
|
74
74
|
"localeData": ["nbsp", "quotes"],
|
|
75
75
|
"summary": "Insert no-break and narrow no-break spaces per locale. Runs last so that every other rule has already settled the surrounding characters."
|
|
76
76
|
}
|