satorigear 0.0.13 → 0.1.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.
package/README.md CHANGED
@@ -15,8 +15,8 @@
15
15
  src="https://img.shields.io/npm/dm/satorigear?color=EA7FA0&labelColor=232122"
16
16
  alt="[downloads]"
17
17
  ></a>
18
- <a href="https://github.com/KazariEX/satorigear/blob/main/LICENSE"><img
19
- src="https://img.shields.io/github/license/KazariEX/satorigear?color=EA7FA0&labelColor=232122"
18
+ <a href="https://github.com/yggdrasilp/satorigear/blob/main/LICENSE"><img
19
+ src="https://img.shields.io/github/license/yggdrasilp/satorigear?color=EA7FA0&labelColor=232122"
20
20
  alt="[license]"
21
21
  ></a>
22
22
  </p>
@@ -40,6 +40,8 @@ const parser = createParser({
40
40
  features: {
41
41
  attributes: true,
42
42
  binding: true,
43
+ breaks: true,
44
+ cjk: true,
43
45
  component: true,
44
46
  emoji: true,
45
47
  footnote: true,
@@ -65,11 +67,11 @@ const mdast = document.tree;
65
67
 
66
68
  ## Performance
67
69
 
68
- Benchmarked against Sätteri <sup>0.11.6</sup> and Remark (`mdast-util-from-markdown@2.0.3`), which also produce MDAST, with feature sets kept as equivalent as possible for each profile.
70
+ Benchmarked against Sätteri <sup>0.11.7</sup> and Remark (`mdast-util-from-markdown@2.0.3`), which also produce MDAST, with feature sets kept as equivalent as possible for each profile.
69
71
 
70
72
  <!-- benchmark:start environment -->
71
73
 
72
- > Median of 4 isolated mean-time runs at commit [`7076a95`](https://github.com/KazariEX/satorigear/commit/7076a95832c4fa9d764ad25f39aa8e518513e2b3) on Apple M3, node 26.13.1, arm64-darwin.
74
+ > Median of 4 isolated mean-time runs at commit [`015e214`](https://github.com/yggdrasilp/satorigear/commit/015e21484e4ee88b2cd4dddb4f7c729d3667a5e1) on Apple M3, node 26.13.1, arm64-darwin.
73
75
  > SatoriGear and Sätteri run in paired AB/BA order; comparisons are normalized to SatoriGear (↑ faster, ↓ slower). Lower time and higher throughput are better.
74
76
 
75
77
  <!-- benchmark:end -->
@@ -82,17 +84,17 @@ Benchmarked against Sätteri <sup>0.11.6</sup> and Remark (`mdast-util-from-mark
82
84
 
83
85
  | Engine | Mean time | vs. SatoriGear | Throughput |
84
86
  | --- | ---: | ---: | ---: |
85
- | **SatoriGear** | 342 µs | baseline | 571 MiB/s |
86
- | Sätteri | 924 µs | ↓ 2.70× | 212 MiB/s |
87
- | Remark | 60.7 ms | ↓ 177.36× | 3.22 MiB/s |
87
+ | **SatoriGear** | 337 µs | baseline | 580 MiB/s |
88
+ | Sätteri | 915 µs | ↓ 2.71× | 214 MiB/s |
89
+ | Remark | 60.4 ms | ↓ 179.27× | 3.24 MiB/s |
88
90
 
89
91
  #### CommonMark 0.31.2 examples, 14919 bytes, 652 documents
90
92
 
91
93
  | Engine | Mean time | vs. SatoriGear | Throughput |
92
94
  | --- | ---: | ---: | ---: |
93
- | **SatoriGear** | 320 µs | baseline | 44.4 MiB/s |
94
- | Sätteri | 1.43 ms | ↓ 4.48× | 9.92 MiB/s |
95
- | Remark | 25.2 ms | ↓ 78.64× | 0.56 MiB/s |
95
+ | **SatoriGear** | 317 µs | baseline | 44.8 MiB/s |
96
+ | Sätteri | 1.43 ms | ↓ 4.50× | 9.97 MiB/s |
97
+ | Remark | 25.2 ms | ↓ 79.31× | 0.57 MiB/s |
96
98
 
97
99
  ### Built-in features
98
100
 
@@ -100,14 +102,14 @@ Benchmarked against Sätteri <sup>0.11.6</sup> and Remark (`mdast-util-from-mark
100
102
 
101
103
  | Engine | Mean time | vs. SatoriGear | Throughput |
102
104
  | --- | ---: | ---: | ---: |
103
- | **SatoriGear** | 8.20 ms | baseline | 106 MiB/s |
104
- | Sätteri | 12.5 ms | ↓ 1.52× | 69.7 MiB/s |
105
+ | **SatoriGear** | 7.54 ms | baseline | 115 MiB/s |
106
+ | Sätteri | 12.3 ms | ↓ 1.63× | 70.6 MiB/s |
105
107
 
106
108
  #### Public APIs README, 232580 bytes, 1 document
107
109
 
108
110
  | Engine | Mean time | vs. SatoriGear | Throughput |
109
111
  | --- | ---: | ---: | ---: |
110
- | **SatoriGear** | 1.79 ms | baseline | 124 MiB/s |
111
- | Sätteri | 2.65 ms | ↓ 1.48× | 83.7 MiB/s |
112
+ | **SatoriGear** | 1.43 ms | baseline | 155 MiB/s |
113
+ | Sätteri | 2.65 ms | ↓ 1.85× | 83.7 MiB/s |
112
114
 
113
115
  <!-- benchmark:end -->
package/dist/index.d.mts CHANGED
@@ -50,16 +50,53 @@ declare module "mdast" {
50
50
  math: Math;
51
51
  }
52
52
  }
53
+ /** All features are off by default (CommonMark only). */
53
54
  interface FeatureOptions {
55
+ /**
56
+ * Attribute lists wrapped in curly braces.
57
+ * @example `{.class #id foo="bar"}`
58
+ */
54
59
  attributes?: boolean;
60
+ /**
61
+ * Mustache-style interpolation with an optional fallback value.
62
+ * @example `{{ interpolation || fallback }}`
63
+ */
55
64
  binding?: boolean;
65
+ /** Soft line breaks as hard breaks. */
66
+ breaks?: boolean;
67
+ /**
68
+ * CJK-friendly emphasis and strikethrough boundaries.
69
+ * @example `**你好,**世界。`
70
+ */
71
+ cjk?: boolean;
72
+ /**
73
+ * MDC-style block and inline components.
74
+ *
75
+ * A leading YAML props block inside a block component is kept as a raw `Yaml` node without built-in YAML parsing.
76
+ * @example `::name`...`::` / `:name[content]{attrs}`
77
+ */
56
78
  component?: boolean;
79
+ /**
80
+ * Colon-wrapped Emoji shortcodes.
81
+ *
82
+ * Each node retains the raw shortcode in {@link Emoji.value | value} without built-in conversion.
83
+ * @example `:smile:`
84
+ */
57
85
  emoji?: boolean;
86
+ /** GFM footnotes. */
58
87
  footnote?: boolean;
88
+ /** Frontmatter, with `anywhere` intentionally unsupported. */
59
89
  frontmatter?: boolean | FrontmatterOptions;
90
+ /**
91
+ * Block and inline math.
92
+ * @example `$$`...`$$` / `$x = y + 1$`
93
+ */
60
94
  math?: boolean | MathOptions;
95
+ /** GFM strikethrough. */
61
96
  strikethrough?: boolean | StrikethroughOptions;
97
+ /** GFM tables. */
62
98
  table?: boolean;
99
+ /** GFM task lists. */
63
100
  taskList?: boolean;
64
101
  }
65
102
  export interface Parser {