@pretextbook/ptxast-util-to-mdast 0.0.3 → 0.0.5
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 +13 -1
- package/dist/index.cjs +6 -2
- package/dist/index.js +89 -88
- package/dist/lib/ptxast-to-mdast.d.ts +15 -1
- package/dist/lib/ptxast-util-to-mdast.d.ts +4 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,7 +28,19 @@ Converts a `PtxRoot` tree to an mdast `Root` tree with directive nodes for PreTe
|
|
|
28
28
|
|
|
29
29
|
### `ptxastToMarkdown(root: PtxRoot): string`
|
|
30
30
|
|
|
31
|
-
Converts a `PtxRoot` tree to a Markdown string. Theorem-like environments render as `:::theorem` directive fences; divisions render as ATX headings (
|
|
31
|
+
Converts a `PtxRoot` tree to a Markdown string. Theorem-like environments render as `:::theorem` directive fences; divisions render as ATX headings, relative to the document's actual outermost division (a depth-1 heading is whatever that division is — `chapter`, `section`, `part`, ...).
|
|
32
|
+
|
|
33
|
+
When the outermost division isn't `chapter` (the default a depth-1 heading is assumed to mean by [`@pretextbook/remark-pretext`](../remark-pretext)), a `division:` frontmatter block is prepended so the markdown can be converted back to PreTeXt unambiguously:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
---
|
|
37
|
+
division: section
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
# Top-level section
|
|
41
|
+
|
|
42
|
+
## A subsection
|
|
43
|
+
```
|
|
32
44
|
|
|
33
45
|
## License
|
|
34
46
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@pretextbook/ptxast"),
|
|
2
|
-
`)}}function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@pretextbook/ptxast"),T=require("mdast-util-to-markdown"),b=require("mdast-util-directive"),w=require("mdast-util-math"),g=new Set([...p.DIVISION_HIERARCHY,"appendix"]),k=new Set(["pretext","book","article","frontmatter","backmatter"]),M=new Map([["theorem",{name:"theorem",category:"theorem-like"}],["lemma",{name:"lemma",category:"theorem-like"}],["corollary",{name:"corollary",category:"theorem-like"}],["proposition",{name:"proposition",category:"theorem-like"}],["claim",{name:"claim",category:"theorem-like"}],["fact",{name:"fact",category:"theorem-like"}],["conjecture",{name:"conjecture",category:"theorem-like"}],["axiom",{name:"axiom",category:"theorem-like"}],["principle",{name:"principle",category:"theorem-like"}],["hypothesis",{name:"hypothesis",category:"theorem-like"}],["algorithm",{name:"algorithm",category:"theorem-like"}],["definition",{name:"definition",category:"definition-like"}],["notation",{name:"notation",category:"definition-like"}],["remark",{name:"remark",category:"remark-like"}],["note",{name:"note",category:"remark-like"}],["observation",{name:"observation",category:"remark-like"}],["warning",{name:"warning",category:"remark-like"}],["insight",{name:"insight",category:"remark-like"}],["assemblage",{name:"assemblage",category:"remark-like"}],["example",{name:"example",category:"example-like"}],["question",{name:"question",category:"example-like"}],["problem",{name:"problem",category:"example-like"}],["exercise",{name:"exercise",category:"example-like"}],["activity",{name:"activity",category:"example-like"}],["exploration",{name:"exploration",category:"example-like"}],["investigation",{name:"investigation",category:"example-like"}],["project",{name:"project",category:"example-like"}],["proof",{name:"proof",category:"proof-like"}],["case",{name:"case",category:"proof-like"}],["solution",{name:"solution",category:"solution-like"}],["hint",{name:"hint",category:"solution-like"}],["answer",{name:"answer",category:"solution-like"}]]),P=new Set(["theorem-like","definition-like"]);function x(e){return{type:"root",children:d(e.children,1)}}function v(e){for(const t of e){if(t.type!=="element")continue;const n=t;if(g.has(n.name))return n.name;if(k.has(n.name)){const i=v(n.children);if(i)return i}}}function d(e,t){const n=[];for(const i of e){if(i.type!=="element")continue;const a=i;if(k.has(a.name))n.push(...d(a.children,t));else if(g.has(a.name))n.push(...E(a,Math.min(t,6)));else{const l=u(a);l!==null&&n.push(l)}}return n}function E(e,t){const n=[],i=e.attributes??{},a=e.children,l=a.find(o=>o.type==="element"&&o.name==="title"),s=a.filter(o=>!(o.type==="element"&&o.name==="title")),r={type:"heading",depth:t,children:l?l.children.map(h).filter(m):[],...i["xml:id"]?{data:{id:i["xml:id"],hProperties:{id:i["xml:id"]}}}:{}};n.push(r);const c=Math.min(t+1,6);return n.push(...d(s,c)),n}function u(e){switch(e.name){case"p":return I(e);case"blockquote":return S(e);case"ol":return y(e,!0);case"ul":return y(e,!1);case"program":return D(e);case"me":case"men":case"md":case"mdn":return N(e);default:{const t=M.get(e.name);return t?q(e,t):null}}}function I(e){return{type:"paragraph",children:e.children.map(h).filter(m)}}function S(e){return{type:"blockquote",children:e.children.filter(t=>t.type==="element").map(t=>u(t)).filter(m)}}function y(e,t){return{type:"list",ordered:t,spread:!1,children:e.children.filter(n=>n.type==="element").map(n=>C(n))}}function C(e){return{type:"listItem",spread:!1,children:e.children.filter(t=>t.type==="element").map(t=>u(t)).filter(m)}}function D(e){return{type:"code",lang:(e.attributes??{}).language??null,value:p.getPtxTextContent(e)}}function N(e){const t=e.children;return t.length>0&&t[0].type==="text"?{type:"math",value:p.getPtxTextContent(e)}:{type:"math",value:t.filter(i=>i.type==="element"&&i.name==="mrow").map(i=>p.getPtxTextContent(i)).join(` \\\\
|
|
2
|
+
`)}}function q(e,t){const n=e.attributes??{},i=e.children,a={};n["xml:id"]&&(a.id=n["xml:id"]);for(const[r,c]of Object.entries(n))r==="xml:id"||c==null||(a[r]=c);const l=i.find(r=>r.type==="element"&&r.name==="title"),s=[];if(l){const r={type:"paragraph",data:{directiveLabel:!0},children:l.children.map(h).filter(m)};s.push(r)}if(P.has(t.category))for(const r of i){if(r.type!=="element")continue;const c=r;if(c.name!=="title")if(c.name==="statement")for(const o of c.children){if(o.type!=="element")continue;const f=u(o);f&&s.push(f)}else{const o=u(c);o&&s.push(o)}}else for(const r of i){if(r.type!=="element")continue;const c=r;if(c.name==="title")continue;const o=u(c);o&&s.push(o)}return{type:"containerDirective",name:t.name,attributes:Object.keys(a).length>0?a:void 0,children:s}}function h(e){if(e.type==="text")return{type:"text",value:e.value??""};if(e.type!=="element")return null;const t=e;switch(t.name){case"em":return{type:"emphasis",children:t.children.map(h).filter(m)};case"alert":return{type:"strong",children:t.children.map(h).filter(m)};case"c":return{type:"inlineCode",value:p.getPtxTextContent(t)};case"m":return{type:"inlineMath",value:p.getPtxTextContent(t)};default:return null}}function m(e){return e!==null}function j(e){const t=x(e),n=T.toMarkdown(t,{extensions:[b.directiveToMarkdown(),w.mathToMarkdown()]}),i=v(e.children);return!i||i==="chapter"?n:`---
|
|
3
|
+
division: ${i}
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
${n}`}exports.ptxastToMarkdown=j;exports.ptxastToMdast=x;
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,17 @@
|
|
|
1
|
-
import { getPtxTextContent as
|
|
2
|
-
import { toMarkdown as
|
|
3
|
-
import { directiveToMarkdown as
|
|
4
|
-
import { mathToMarkdown as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
"section",
|
|
8
|
-
"subsection",
|
|
9
|
-
"subsubsection",
|
|
10
|
-
"paragraphs",
|
|
11
|
-
// appendix is division-like at the same level as chapter
|
|
1
|
+
import { DIVISION_HIERARCHY as x, getPtxTextContent as p } from "@pretextbook/ptxast";
|
|
2
|
+
import { toMarkdown as b } from "mdast-util-to-markdown";
|
|
3
|
+
import { directiveToMarkdown as T } from "mdast-util-directive";
|
|
4
|
+
import { mathToMarkdown as w } from "mdast-util-math";
|
|
5
|
+
const g = /* @__PURE__ */ new Set([
|
|
6
|
+
...x,
|
|
12
7
|
"appendix"
|
|
13
|
-
]),
|
|
14
|
-
chapter: 1,
|
|
15
|
-
section: 2,
|
|
16
|
-
subsection: 3,
|
|
17
|
-
subsubsection: 4,
|
|
18
|
-
paragraphs: 5,
|
|
19
|
-
appendix: 1
|
|
20
|
-
}, T = /* @__PURE__ */ new Set([
|
|
8
|
+
]), k = /* @__PURE__ */ new Set([
|
|
21
9
|
"pretext",
|
|
22
10
|
"book",
|
|
23
11
|
"article",
|
|
24
12
|
"frontmatter",
|
|
25
|
-
"backmatter"
|
|
26
|
-
|
|
27
|
-
]), w = /* @__PURE__ */ new Map([
|
|
13
|
+
"backmatter"
|
|
14
|
+
]), E = /* @__PURE__ */ new Map([
|
|
28
15
|
// theorem-like
|
|
29
16
|
["theorem", { name: "theorem", category: "theorem-like" }],
|
|
30
17
|
["lemma", { name: "lemma", category: "theorem-like" }],
|
|
@@ -63,78 +50,88 @@ const x = /* @__PURE__ */ new Set([
|
|
|
63
50
|
["solution", { name: "solution", category: "solution-like" }],
|
|
64
51
|
["hint", { name: "hint", category: "solution-like" }],
|
|
65
52
|
["answer", { name: "answer", category: "solution-like" }]
|
|
66
|
-
]),
|
|
67
|
-
function
|
|
53
|
+
]), I = /* @__PURE__ */ new Set(["theorem-like", "definition-like"]);
|
|
54
|
+
function M(e) {
|
|
68
55
|
return {
|
|
69
56
|
type: "root",
|
|
70
|
-
children:
|
|
57
|
+
children: h(e.children, 1)
|
|
71
58
|
};
|
|
72
59
|
}
|
|
73
|
-
function
|
|
60
|
+
function v(e) {
|
|
61
|
+
for (const t of e) {
|
|
62
|
+
if (t.type !== "element") continue;
|
|
63
|
+
const n = t;
|
|
64
|
+
if (g.has(n.name)) return n.name;
|
|
65
|
+
if (k.has(n.name)) {
|
|
66
|
+
const r = v(n.children);
|
|
67
|
+
if (r) return r;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function h(e, t) {
|
|
74
72
|
const n = [];
|
|
75
73
|
for (const r of e) {
|
|
76
74
|
if (r.type !== "element") continue;
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
n.push(...
|
|
80
|
-
else if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const l = p(o);
|
|
75
|
+
const a = r;
|
|
76
|
+
if (k.has(a.name))
|
|
77
|
+
n.push(...h(a.children, t));
|
|
78
|
+
else if (g.has(a.name))
|
|
79
|
+
n.push(...P(a, Math.min(t, 6)));
|
|
80
|
+
else {
|
|
81
|
+
const l = u(a);
|
|
85
82
|
l !== null && n.push(l);
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
85
|
return n;
|
|
89
86
|
}
|
|
90
|
-
function
|
|
91
|
-
const n = [], r = e.attributes ?? {},
|
|
92
|
-
(
|
|
93
|
-
),
|
|
94
|
-
(
|
|
87
|
+
function P(e, t) {
|
|
88
|
+
const n = [], r = e.attributes ?? {}, a = e.children, l = a.find(
|
|
89
|
+
(o) => o.type === "element" && o.name === "title"
|
|
90
|
+
), m = a.filter(
|
|
91
|
+
(o) => !(o.type === "element" && o.name === "title")
|
|
95
92
|
), i = {
|
|
96
93
|
type: "heading",
|
|
97
94
|
depth: t,
|
|
98
|
-
children: l ? l.children.map(
|
|
95
|
+
children: l ? l.children.map(f).filter(s) : [],
|
|
99
96
|
...r["xml:id"] ? { data: { id: r["xml:id"], hProperties: { id: r["xml:id"] } } } : {}
|
|
100
97
|
};
|
|
101
98
|
n.push(i);
|
|
102
99
|
const c = Math.min(t + 1, 6);
|
|
103
|
-
return n.push(...
|
|
100
|
+
return n.push(...h(m, c)), n;
|
|
104
101
|
}
|
|
105
|
-
function
|
|
102
|
+
function u(e) {
|
|
106
103
|
switch (e.name) {
|
|
107
104
|
case "p":
|
|
108
|
-
return
|
|
105
|
+
return D(e);
|
|
109
106
|
case "blockquote":
|
|
110
|
-
return
|
|
107
|
+
return N(e);
|
|
111
108
|
case "ol":
|
|
112
109
|
return y(e, !0);
|
|
113
110
|
case "ul":
|
|
114
111
|
return y(e, !1);
|
|
115
112
|
case "program":
|
|
116
|
-
return
|
|
113
|
+
return A(e);
|
|
117
114
|
case "me":
|
|
118
115
|
case "men":
|
|
119
116
|
case "md":
|
|
120
117
|
case "mdn":
|
|
121
|
-
return
|
|
118
|
+
return _(e);
|
|
122
119
|
default: {
|
|
123
|
-
const t =
|
|
124
|
-
return t ?
|
|
120
|
+
const t = E.get(e.name);
|
|
121
|
+
return t ? j(e, t) : null;
|
|
125
122
|
}
|
|
126
123
|
}
|
|
127
124
|
}
|
|
128
|
-
function
|
|
125
|
+
function D(e) {
|
|
129
126
|
return {
|
|
130
127
|
type: "paragraph",
|
|
131
|
-
children: e.children.map(
|
|
128
|
+
children: e.children.map(f).filter(s)
|
|
132
129
|
};
|
|
133
130
|
}
|
|
134
|
-
function
|
|
131
|
+
function N(e) {
|
|
135
132
|
return {
|
|
136
133
|
type: "blockquote",
|
|
137
|
-
children: e.children.filter((t) => t.type === "element").map((t) =>
|
|
134
|
+
children: e.children.filter((t) => t.type === "element").map((t) => u(t)).filter(s)
|
|
138
135
|
};
|
|
139
136
|
}
|
|
140
137
|
function y(e, t) {
|
|
@@ -142,58 +139,58 @@ function y(e, t) {
|
|
|
142
139
|
type: "list",
|
|
143
140
|
ordered: t,
|
|
144
141
|
spread: !1,
|
|
145
|
-
children: e.children.filter((n) => n.type === "element").map((n) =>
|
|
142
|
+
children: e.children.filter((n) => n.type === "element").map((n) => S(n))
|
|
146
143
|
};
|
|
147
144
|
}
|
|
148
|
-
function
|
|
145
|
+
function S(e) {
|
|
149
146
|
return {
|
|
150
147
|
type: "listItem",
|
|
151
148
|
spread: !1,
|
|
152
|
-
children: e.children.filter((t) => t.type === "element").map((t) =>
|
|
149
|
+
children: e.children.filter((t) => t.type === "element").map((t) => u(t)).filter(s)
|
|
153
150
|
};
|
|
154
151
|
}
|
|
155
|
-
function
|
|
152
|
+
function A(e) {
|
|
156
153
|
return {
|
|
157
154
|
type: "code",
|
|
158
155
|
lang: (e.attributes ?? {}).language ?? null,
|
|
159
|
-
value:
|
|
156
|
+
value: p(e)
|
|
160
157
|
};
|
|
161
158
|
}
|
|
162
|
-
function
|
|
159
|
+
function _(e) {
|
|
163
160
|
const t = e.children;
|
|
164
|
-
return t.length > 0 && t[0].type === "text" ? { type: "math", value:
|
|
161
|
+
return t.length > 0 && t[0].type === "text" ? { type: "math", value: p(e) } : { type: "math", value: t.filter((r) => r.type === "element" && r.name === "mrow").map((r) => p(r)).join(` \\\\
|
|
165
162
|
`) };
|
|
166
163
|
}
|
|
167
|
-
function
|
|
168
|
-
const n = e.attributes ?? {}, r = e.children,
|
|
169
|
-
n["xml:id"] && (
|
|
164
|
+
function j(e, t) {
|
|
165
|
+
const n = e.attributes ?? {}, r = e.children, a = {};
|
|
166
|
+
n["xml:id"] && (a.id = n["xml:id"]);
|
|
170
167
|
for (const [i, c] of Object.entries(n))
|
|
171
|
-
i === "xml:id" || c == null || (
|
|
168
|
+
i === "xml:id" || c == null || (a[i] = c);
|
|
172
169
|
const l = r.find(
|
|
173
170
|
(i) => i.type === "element" && i.name === "title"
|
|
174
|
-
),
|
|
171
|
+
), m = [];
|
|
175
172
|
if (l) {
|
|
176
173
|
const i = {
|
|
177
174
|
type: "paragraph",
|
|
178
175
|
data: { directiveLabel: !0 },
|
|
179
|
-
children: l.children.map(
|
|
176
|
+
children: l.children.map(f).filter(s)
|
|
180
177
|
};
|
|
181
|
-
|
|
178
|
+
m.push(i);
|
|
182
179
|
}
|
|
183
|
-
if (
|
|
180
|
+
if (I.has(t.category))
|
|
184
181
|
for (const i of r) {
|
|
185
182
|
if (i.type !== "element") continue;
|
|
186
183
|
const c = i;
|
|
187
184
|
if (c.name !== "title")
|
|
188
185
|
if (c.name === "statement")
|
|
189
|
-
for (const
|
|
190
|
-
if (
|
|
191
|
-
const d =
|
|
192
|
-
d &&
|
|
186
|
+
for (const o of c.children) {
|
|
187
|
+
if (o.type !== "element") continue;
|
|
188
|
+
const d = u(o);
|
|
189
|
+
d && m.push(d);
|
|
193
190
|
}
|
|
194
191
|
else {
|
|
195
|
-
const
|
|
196
|
-
|
|
192
|
+
const o = u(c);
|
|
193
|
+
o && m.push(o);
|
|
197
194
|
}
|
|
198
195
|
}
|
|
199
196
|
else
|
|
@@ -201,17 +198,17 @@ function _(e, t) {
|
|
|
201
198
|
if (i.type !== "element") continue;
|
|
202
199
|
const c = i;
|
|
203
200
|
if (c.name === "title") continue;
|
|
204
|
-
const
|
|
205
|
-
|
|
201
|
+
const o = u(c);
|
|
202
|
+
o && m.push(o);
|
|
206
203
|
}
|
|
207
204
|
return {
|
|
208
205
|
type: "containerDirective",
|
|
209
206
|
name: t.name,
|
|
210
|
-
attributes: Object.keys(
|
|
211
|
-
children:
|
|
207
|
+
attributes: Object.keys(a).length > 0 ? a : void 0,
|
|
208
|
+
children: m
|
|
212
209
|
};
|
|
213
210
|
}
|
|
214
|
-
function
|
|
211
|
+
function f(e) {
|
|
215
212
|
if (e.type === "text")
|
|
216
213
|
return { type: "text", value: e.value ?? "" };
|
|
217
214
|
if (e.type !== "element") return null;
|
|
@@ -220,31 +217,35 @@ function h(e) {
|
|
|
220
217
|
case "em":
|
|
221
218
|
return {
|
|
222
219
|
type: "emphasis",
|
|
223
|
-
children: t.children.map(
|
|
220
|
+
children: t.children.map(f).filter(s)
|
|
224
221
|
};
|
|
225
222
|
case "alert":
|
|
226
223
|
return {
|
|
227
224
|
type: "strong",
|
|
228
|
-
children: t.children.map(
|
|
225
|
+
children: t.children.map(f).filter(s)
|
|
229
226
|
};
|
|
230
227
|
case "c":
|
|
231
|
-
return { type: "inlineCode", value:
|
|
228
|
+
return { type: "inlineCode", value: p(t) };
|
|
232
229
|
case "m":
|
|
233
|
-
return { type: "inlineMath", value:
|
|
230
|
+
return { type: "inlineMath", value: p(t) };
|
|
234
231
|
default:
|
|
235
232
|
return null;
|
|
236
233
|
}
|
|
237
234
|
}
|
|
238
|
-
function
|
|
235
|
+
function s(e) {
|
|
239
236
|
return e !== null;
|
|
240
237
|
}
|
|
241
238
|
function O(e) {
|
|
242
|
-
const t =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
239
|
+
const t = M(e), n = b(t, {
|
|
240
|
+
extensions: [T(), w()]
|
|
241
|
+
}), r = v(e.children);
|
|
242
|
+
return !r || r === "chapter" ? n : `---
|
|
243
|
+
division: ${r}
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
${n}`;
|
|
246
247
|
}
|
|
247
248
|
export {
|
|
248
249
|
O as ptxastToMarkdown,
|
|
249
|
-
|
|
250
|
+
M as ptxastToMdast
|
|
250
251
|
};
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { Root as MdastRoot } from 'mdast';
|
|
2
|
-
import { Root } from '@pretextbook/ptxast';
|
|
2
|
+
import { Root, ElementContent } from '@pretextbook/ptxast';
|
|
3
|
+
export declare const DIVISION_TYPE_NAMES: Set<string>;
|
|
4
|
+
/**
|
|
5
|
+
* Structural container types whose content should be recursed into
|
|
6
|
+
* without emitting a heading, and without changing the current depth.
|
|
7
|
+
* This handles full ptxast trees that include a `pretext > book > chapter`
|
|
8
|
+
* hierarchy.
|
|
9
|
+
*/
|
|
10
|
+
export declare const TRANSPARENT_TYPES: Set<string>;
|
|
3
11
|
/** Convert an xast Root (PreTeXt document) to an mdast Root. */
|
|
4
12
|
export declare function ptxastToMdast(root: Root): MdastRoot;
|
|
13
|
+
/**
|
|
14
|
+
* Find the name of the outermost division in a ptxast tree (skipping
|
|
15
|
+
* transparent structural wrappers), i.e. the division a depth-1 heading
|
|
16
|
+
* would represent if this tree were flattened to markdown.
|
|
17
|
+
*/
|
|
18
|
+
export declare function findTopLevelDivision(nodes: ElementContent[]): string | undefined;
|
|
@@ -3,5 +3,9 @@ export { ptxastToMdast } from './ptxast-to-mdast.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Convert an xast Root (PreTeXt document) to a markdown string using the directive
|
|
5
5
|
* syntax for PreTeXt block environments.
|
|
6
|
+
*
|
|
7
|
+
* When the document's outermost division isn't `chapter` (the default a
|
|
8
|
+
* depth-1 heading is assumed to mean), a `division:` frontmatter block is
|
|
9
|
+
* prepended so the markdown can be converted back to PreTeXt unambiguously.
|
|
6
10
|
*/
|
|
7
11
|
export declare function ptxastToMarkdown(root: Root): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pretextbook/ptxast-util-to-mdast",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Convert ptxast to mdast (markdown AST) and markdown strings",
|
|
5
5
|
"author": "Oscar Levin",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"test": "vitest run"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@pretextbook/ptxast": "^0.0.
|
|
42
|
+
"@pretextbook/ptxast": "^0.0.5",
|
|
43
43
|
"@types/mdast": "^4.0.0",
|
|
44
44
|
"mdast-util-directive": "^3.0.0",
|
|
45
45
|
"mdast-util-math": "^3.0.0",
|