Skip to content

Commit 26910e6

Browse files
committed
Refactor docs
1 parent 27f6550 commit 26910e6

File tree

1 file changed

+65
-60
lines changed

1 file changed

+65
-60
lines changed

readme.md

Lines changed: 65 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
***
66

7-
**mdast** is a specification for representing Markdown in a [syntax
7+
**mdast** is a specification for representing markdown in a [syntax
88
tree][syntax-tree].
9-
It implements the [**unist**][unist] spec.
10-
It can represent several flavours of [Markdown][], such as [CommonMark][]
9+
It implements **[unist][]**.
10+
It can represent several flavours of [markdown][], such as [CommonMark][]
1111
and [GitHub Flavored Markdown][gfm].
1212

1313
This document may not be released.
@@ -58,6 +58,7 @@ The latest released version is [`4.0.0`][latest].
5858
* [GFM](#gfm)
5959
* [Frontmatter](#frontmatter)
6060
* [Footnotes](#footnotes)
61+
* [MDX](#mdx)
6162
* [Glossary](#glossary)
6263
* [List of utilities](#list-of-utilities)
6364
* [References](#references)
@@ -69,10 +70,10 @@ The latest released version is [`4.0.0`][latest].
6970

7071
## Introduction
7172

72-
This document defines a format for representing [Markdown][] as an [abstract
73+
This document defines a format for representing [markdown][] as an [abstract
7374
syntax tree][syntax-tree].
74-
Development of mdast started in July 2014, in [**remark**][remark], before
75-
[unist][] existed.
75+
Development of mdast started in July 2014, in **[remark][]**, before [unist][]
76+
existed.
7677
This specification is written in a [Web IDL][webidl]-like grammar.
7778

7879
### Where this specification fits
@@ -99,8 +100,8 @@ interface Parent <: UnistParent {
99100
}
100101
```
101102

102-
**Parent** ([**UnistParent**][dfn-unist-parent]) represents a node in mdast
103-
containing other nodes (said to be [*children*][term-child]).
103+
**Parent** ([**UnistParent**][dfn-unist-parent]) represents an abstract
104+
interface in mdast containing other nodes (said to be [*children*][term-child]).
104105

105106
Its content is limited to only other [**mdast content**][dfn-mdast-content].
106107

@@ -112,8 +113,8 @@ interface Literal <: UnistLiteral {
112113
}
113114
```
114115

115-
**Literal** ([**UnistLiteral**][dfn-unist-literal]) represents a node in mdast
116-
containing a value.
116+
**Literal** ([**UnistLiteral**][dfn-unist-literal]) represents an abstract
117+
interface in mdast containing a value.
117118

118119
Its `value` field is a `string`.
119120

@@ -129,9 +130,9 @@ interface Root <: Parent {
129130

130131
**Root** can be used as the [*root*][term-root] of a [*tree*][term-tree], never
131132
as a [*child*][term-child].
132-
Its content model is not limited to [**flow**][dfn-flow-content] content, but
133-
can contain any [**mdast content**][dfn-mdast-content] with the restriction that
134-
all content must be of the same category.
133+
Its content model is **not** limited to [**flow**][dfn-flow-content] content,
134+
but instead can contain any [**mdast content**][dfn-mdast-content] with the
135+
restriction that all content must be of the same category.
135136

136137
### `Paragraph`
137138

@@ -148,7 +149,7 @@ with a particular point or idea.
148149
**Paragraph** can be used where [**content**][dfn-content] is expected.
149150
Its content model is [**phrasing**][dfn-phrasing-content] content.
150151

151-
For example, the following Markdown:
152+
For example, the following markdown:
152153

153154
```markdown
154155
Alpha bravo charlie.
@@ -181,7 +182,7 @@ Its content model is [**phrasing**][dfn-phrasing-content] content.
181182
A `depth` field must be present.
182183
A value of `1` is said to be the highest rank and `6` the lowest.
183184

184-
For example, the following Markdown:
185+
For example, the following markdown:
185186

186187
```markdown
187188
# Alpha
@@ -212,7 +213,7 @@ scene change in a story, a transition to another topic, or a new document.
212213
expected.
213214
It has no content model.
214215

215-
For example, the following Markdown:
216+
For example, the following markdown:
216217

217218
```markdown
218219
***
@@ -240,7 +241,7 @@ somewhere else.
240241
expected.
241242
Its content model is also [**flow**][dfn-flow-content] content.
242243

243-
For example, the following Markdown:
244+
For example, the following markdown:
244245

245246
```markdown
246247
> Alpha bravo charlie.
@@ -288,7 +289,7 @@ It represents that one or more of its children are separated with a blank line
288289
from its [siblings][term-sibling] (when `true`), or not (when `false` or not
289290
present).
290291

291-
For example, the following Markdown:
292+
For example, the following markdown:
292293

293294
```markdown
294295
1. foo
@@ -333,7 +334,7 @@ A `spread` field can be present.
333334
It represents that the item contains two or more [*children*][term-child]
334335
separated by a blank line (when `true`), or not (when `false` or not present).
335336

336-
For example, the following Markdown:
337+
For example, the following markdown:
337338

338339
```markdown
339340
* bar
@@ -369,7 +370,7 @@ Its content is represented by its `value` field.
369370
HTML nodes do not have the restriction of being valid or complete HTML
370371
([\[HTML\]][html]) constructs.
371372

372-
For example, the following Markdown:
373+
For example, the following markdown:
373374

374375
```markdown
375376
<div>
@@ -406,7 +407,7 @@ It represents the language of computer code being marked up.
406407
If the `lang` field is present, a `meta` field can be present.
407408
It represents custom information relating to the node.
408409

409-
For example, the following Markdown:
410+
For example, the following markdown:
410411

411412
```markdown
412413
foo()
@@ -423,7 +424,7 @@ Yields:
423424
}
424425
```
425426

426-
And the following Markdown:
427+
And the following markdown:
427428

428429
````markdown
429430
```js highlight-line="2"
@@ -467,7 +468,7 @@ It has no content model.
467468
[**LinkReferences**][dfn-link-reference] and
468469
[**ImageReferences**][dfn-image-reference].
469470

470-
For example, the following Markdown:
471+
For example, the following markdown:
471472

472473
```markdown
473474
[Alpha]: https://example.com
@@ -499,7 +500,7 @@ interface Text <: Literal {
499500
expected.
500501
Its content is represented by its `value` field.
501502

502-
For example, the following Markdown:
503+
For example, the following markdown:
503504

504505
```markdown
505506
Alpha bravo charlie.
@@ -527,7 +528,7 @@ contents.
527528
expected.
528529
Its content model is [**transparent**][dfn-transparent-content] content.
529530

530-
For example, the following Markdown:
531+
For example, the following markdown:
531532

532533
```markdown
533534
*alpha* _bravo_
@@ -568,7 +569,7 @@ or urgency for its contents.
568569
expected.
569570
Its content model is [**transparent**][dfn-transparent-content] content.
570571

571-
For example, the following Markdown:
572+
For example, the following markdown:
572573

573574
```markdown
574575
**alpha** __bravo__
@@ -611,7 +612,7 @@ Its content is represented by its `value` field.
611612
This node relates to the [**flow**][dfn-flow-content] content concept
612613
[**Code**][dfn-code].
613614

614-
For example, the following Markdown:
615+
For example, the following markdown:
615616

616617
```markdown
617618
`foo()`
@@ -638,7 +639,7 @@ addresses.
638639
expected.
639640
It has no content model.
640641

641-
For example, the following Markdown:
642+
For example, the following markdown:
642643

643644
```markdown
644645
foo··
@@ -677,7 +678,7 @@ Its content model is [**static phrasing**][dfn-static-phrasing-content] content.
677678

678679
**Link** includes the mixin [**Resource**][dfn-mxn-resource].
679680

680-
For example, the following Markdown:
681+
For example, the following markdown:
681682

682683
```markdown
683684
[alpha](https://example.com "bravo")
@@ -714,7 +715,7 @@ It has no content model, but is described by its `alt` field.
714715
**Image** includes the mixins [**Resource**][dfn-mxn-resource] and
715716
[**Alternative**][dfn-mxn-alternative].
716717

717-
For example, the following Markdown:
718+
For example, the following markdown:
718719

719720
```markdown
720721
![alpha](https://example.com/favicon.ico "bravo")
@@ -753,7 +754,7 @@ Its content model is [**static phrasing**][dfn-static-phrasing-content] content.
753754

754755
**LinkReferences** should be associated with a [**Definition**][dfn-definition].
755756

756-
For example, the following Markdown:
757+
For example, the following markdown:
757758

758759
```markdown
759760
[alpha][Bravo]
@@ -794,7 +795,7 @@ It has no content model, but is described by its `alt` field.
794795

795796
**ImageReference** should be associated with a [**Definition**][dfn-definition].
796797

797-
For example, the following Markdown:
798+
For example, the following markdown:
798799

799800
```markdown
800801
![alpha][bravo]
@@ -1005,7 +1006,7 @@ Its content model is also [**flow**][dfn-flow-content] content.
10051006
**FootnoteDefinition** should be associated with
10061007
[**FootnoteReferences**][dfn-footnote-reference].
10071008

1008-
For example, the following Markdown:
1009+
For example, the following markdown:
10091010

10101011
```markdown
10111012
[^alpha]: bravo and charlie.
@@ -1047,7 +1048,7 @@ It has no content model.
10471048
**FootnoteReference** should be associated with a
10481049
[**FootnoteDefinition**][dfn-footnote-definition].
10491050

1050-
For example, the following Markdown:
1051+
For example, the following markdown:
10511052

10521053
```markdown
10531054
[^alpha]
@@ -1084,7 +1085,7 @@ An `align` field can be present.
10841085
If present, it must be a list of [**alignType**s][dfn-enum-align-type].
10851086
It represents how cells in columns are aligned.
10861087

1087-
For example, the following Markdown:
1088+
For example, the following markdown:
10881089

10891090
```markdown
10901091
| foo | bar |
@@ -1196,7 +1197,7 @@ accurate or no longer relevant.
11961197
expected.
11971198
Its content model is [**transparent**][dfn-transparent-content] content.
11981199

1199-
For example, the following Markdown:
1200+
For example, the following markdown:
12001201

12011202
```markdown
12021203
~~alpha~~
@@ -1284,7 +1285,7 @@ the document in the YAML ([\[YAML\]][yaml]) data serialisation language.
12841285
expected.
12851286
Its content is represented by its `value` field.
12861287

1287-
For example, the following Markdown:
1288+
For example, the following markdown:
12881289

12891290
```markdown
12901291
---
@@ -1339,7 +1340,7 @@ document that is outside its flow.
13391340
expected.
13401341
Its content model is also [**phrasing**][dfn-phrasing-content] content.
13411342

1342-
For example, the following Markdown:
1343+
For example, the following markdown:
13431344

13441345
```markdown
13451346
^[alpha bravo]
@@ -1360,6 +1361,10 @@ Yields:
13601361
type StaticPhrasingContentFootnotes = Footnote | StaticPhrasingContent
13611362
```
13621363

1364+
### MDX
1365+
1366+
See [`remark-mdx`](https://mdxjs.com/packages/remark-mdx/#syntax-tree).
1367+
13631368
## Glossary
13641369

13651370
See the [unist glossary][glossary].
@@ -1371,49 +1376,49 @@ See the [unist list of utilities][utilities] for more utilities.
13711376
<!--lint disable list-item-spacing-->
13721377

13731378
* [`mdast-add-list-metadata`](https://gitlab.com/staltz/mdast-add-list-metadata)
1374-
Enhances the metadata of list and listItem nodes
1379+
enhance the metadata of `list` and `listItem` nodes
13751380
* [`mdast-util-assert`](https://github.com/syntax-tree/mdast-util-assert)
1376-
Assert nodes
1381+
assert nodes
13771382
* [`mdast-builder`](https://github.com/mike-north/mdast-builder)
1378-
Build mdast structures with composable functions
1383+
build mdast structures with composable functions
13791384
* [`mdast-comment-marker`](https://github.com/syntax-tree/mdast-comment-marker)
1380-
Parse a comment marker
1385+
parse a comment marker
13811386
* [`mdast-util-compact`](https://github.com/syntax-tree/mdast-util-compact)
1382-
Make a tree compact
1387+
make a tree compact
13831388
* [`mdast-util-definitions`](https://github.com/syntax-tree/mdast-util-definitions)
1384-
Find definition nodes
1389+
find definition nodes
13851390
* [`mdast-util-from-quill-delta`](https://github.com/syntax-tree/mdast-util-from-quill-delta)
1386-
Transform Quill delta to mdast
1391+
transform Quill delta to mdast
13871392
* [`mdast-flatten-image-paragraphs`](https://gitlab.com/staltz/mdast-flatten-image-paragraphs)
1388-
Flatten paragraph and image into one image node
1393+
flatten `paragraph` and `image` into one `image` node
13891394
* [`mdast-flatten-listitem-paragraphs`](https://gitlab.com/staltz/mdast-flatten-listitem-paragraphs)
1390-
Flatten listItem and (nested) paragraph into one listItem node
1395+
flatten `listItem` and (nested) paragraph into one listItem node
13911396
* [`mdast-flatten-nested-lists`](https://gitlab.com/staltz/mdast-flatten-nested-lists)
1392-
Transforms a tree to avoid lists inside lists
1397+
transform a tree to avoid lists in lists
13931398
* [`mdast-util-from-adf`](https://github.com/bitcrowd/mdast-util-from-adf)
1394-
Build mdast sytax tree from Atlassian Document Format (ADF)
1399+
build mdast syntax tree from Atlassian Document Format (ADF)
13951400
* [`mdast-util-heading-range`](https://github.com/syntax-tree/mdast-util-heading-range)
1396-
Markdown heading as ranges
1401+
markdown heading as ranges
13971402
* [`mdast-util-heading-style`](https://github.com/syntax-tree/mdast-util-heading-style)
1398-
Get the style of a heading node
1403+
get the style of a heading node
13991404
* [`mdast-util-inject`](https://github.com/anandthakker/mdast-util-inject)
1400-
Inject a tree into another at a given heading
1405+
inject a tree into another at a given heading
14011406
* [`mdast-move-images-to-root`](https://gitlab.com/staltz/mdast-move-images-to-root)
1402-
Moves image nodes up the tree until they are strict children of the root
1407+
move image nodes up the tree until they are direct children of the root
14031408
* [`mdast-normalize-headings`](https://github.com/syntax-tree/mdast-normalize-headings)
1404-
Ensure at most one top-level heading is in the document
1409+
ensure at most one top-level heading is in the document
14051410
* [`mdast-util-phrasing`](https://github.com/syntax-tree/mdast-util-phrasing)
1406-
Check if a node is phrasing content
1411+
check if a node is phrasing content
14071412
* [`mdast-squeeze-paragraphs`](https://github.com/syntax-tree/mdast-squeeze-paragraphs)
1408-
Remove empty paragraphs
1413+
remove empty paragraphs
14091414
* [`mdast-util-toc`](https://github.com/syntax-tree/mdast-util-toc)
1410-
Generate a Table of Contents from a tree
1415+
generate a table of contents from a tree
14111416
* [`mdast-util-to-hast`](https://github.com/syntax-tree/mdast-util-to-hast)
1412-
Transform to hast
1417+
transform to hast
14131418
* [`mdast-util-to-nlcst`](https://github.com/syntax-tree/mdast-util-to-nlcst)
1414-
Transform to nlcst
1419+
transform to nlcst
14151420
* [`mdast-util-to-string`](https://github.com/syntax-tree/mdast-util-to-string)
1416-
Get the plain text content of a node
1421+
get the plain text content of a node
14171422
* [`mdast-zone`](https://github.com/syntax-tree/mdast-zone)
14181423
— HTML comments as ranges or markers
14191424

0 commit comments

Comments
 (0)