Skip to content

Commit 2e83e5c

Browse files
committed
Update prose
1 parent 3b166ab commit 2e83e5c

File tree

2 files changed

+13
-32
lines changed

2 files changed

+13
-32
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mdast-util-mdx-expression",
33
"version": "0.1.0",
4-
"description": "mdast extension to parse and serialize MDX or MDX.js expressions",
4+
"description": "mdast extension to parse and serialize MDX (or MDX.js) expressions",
55
"license": "MIT",
66
"keywords": [
77
"unist",

readme.md

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
[![Chat][chat-badge]][chat]
1010

1111
Extension for [`mdast-util-from-markdown`][from-markdown] and/or
12-
[`mdast-util-to-markdown`][to-markdown] to support expressions for MDX or MDX.js
13-
in **[mdast][]**.
12+
[`mdast-util-to-markdown`][to-markdown] to support MDX (or MDX.js) expressions.
1413
When parsing (`from-markdown`), must be combined with
1514
[`micromark-extension-mdx-expression`][extension].
1615

@@ -120,7 +119,7 @@ b {true}.
120119
> `mdast-util-mdx-expression/from-markdown` and
121120
> `mdast-util-mdx-expression/to-markdown`.
122121
123-
Support expressions in MDX or MDX.js.
122+
Support MDX (or MDX.js) expressions.
124123
The exports are extensions, respectively for
125124
[`mdast-util-from-markdown`][from-markdown] and
126125
[`mdast-util-to-markdown`][to-markdown].
@@ -146,8 +145,7 @@ interface MDXFlowExpression <: Literal {
146145

147146
**MDXFlowExpression** (**[Literal][dfn-literal]**) represents a JavaScript
148147
expression embedded in flow (block).
149-
It can be used where **[flow expression][dfn-flow-expression-content]** content
150-
is expected.
148+
It can be used where **[flow][dfn-flow-content]** content is expected.
151149
Its content is represented by its `value` field.
152150

153151
For example, the following markdown:
@@ -174,8 +172,7 @@ interface MDXTextExpression <: Literal {
174172

175173
**MDXTextExpression** (**[Literal][dfn-literal]**) represents a JavaScript
176174
expression embedded in text (span, inline).
177-
It can be used where **[phrasing expression][dfn-phrasing-expression-content]**
178-
content is expected.
175+
It can be used where **[phrasing][dfn-phrasing-content]** content is expected.
179176
Its content is represented by its `value` field.
180177

181178
For example, the following markdown:
@@ -192,32 +189,16 @@ Yields:
192189

193190
### Content model
194191

195-
#### `FlowExpressionContent`
196-
197-
```idl
198-
type FlowExpressionContent = MDXFlowExpression
199-
```
200-
201-
**FlowExpression** content represent an embedded JavaScript expression.
202-
203-
#### `PhrasingExpressionContent`
192+
#### `FlowContent` (MDX expression)
204193

205194
```idl
206-
type PhrasingExpressionContent = MDXTextExpression
195+
type FlowContentMdxExpression = MDXFlowExpression | FlowContent
207196
```
208197

209-
**PhrasingExpression** content represent an embedded JavaScript expression.
210-
211198
#### `PhrasingContent` (MDX expression)
212199

213200
```idl
214-
type PhrasingContentMdxExpression = PhrasingExpressionContent | PhrasingContent
215-
```
216-
217-
#### `FlowContent` (MDX expression)
218-
219-
```idl
220-
type FlowContentMdxExpression = FlowExpressionContent | FlowContent
201+
type PhrasingContentMdxExpression = MDXTextExpression | PhrasingContent
221202
```
222203

223204
## Related
@@ -233,13 +214,13 @@ type FlowContentMdxExpression = FlowExpressionContent | FlowContent
233214
* [`syntax-tree/mdast-util-to-markdown`][to-markdown]
234215
— mdast serializer to create markdown from mdast
235216
* `syntax-tree/mdast-util-mdx`
236-
— mdast utility to support all of MDX
217+
— mdast utility to support MDX
237218
* `syntax-tree/mdast-util-mdxjs`
238-
— mdast utility to support all of MDX.js
219+
— mdast utility to support MDX.js
239220
* [`micromark/micromark`][micromark]
240221
— the smallest commonmark-compliant markdown parser that exists
241222
* [`micromark/micromark-extension-mdx-expression`][extension]
242-
— micromark extension to parse expressions
223+
— micromark extension to parse MDX expressions
243224

244225
## Contribute
245226

@@ -311,6 +292,6 @@ abide by its terms.
311292

312293
[dfn-literal]: https://github.com/syntax-tree/mdast#literal
313294

314-
[dfn-flow-expression-content]: #flowexpressioncontent
295+
[dfn-flow-content]: #flowcontent-mdx-expression
315296

316-
[dfn-phrasing-expression-content]: #phrasingexpressioncontent
297+
[dfn-phrasing-content]: #phrasingcontent-mdx-expression

0 commit comments

Comments
 (0)