@@ -905,9 +905,7 @@ Configuration for `createProcessor` (TypeScript type).
905
905
906
906
* ` recmaPlugins ` ([ ` PluggableList ` from ` unified ` ] [ unified-pluggable-list ] ,
907
907
optional)
908
- — list of recma plugins;
909
- this is a new ecosystem, currently in beta, to transform [ esast] [ ] trees
910
- (JavaScript)
908
+ — list of [ recma plugins] [ recma-plugins ]
911
909
912
910
<details ><summary >Expand example</summary >
913
911
@@ -961,10 +959,10 @@ Configuration for `createProcessor` (TypeScript type).
961
959
* ` remarkRehypeOptions ` ([ ` Options ` from
962
960
` remark-rehype ` ] [ remark-rehype-options ] , optional)
963
961
— options to pass through to ` remark-rehype ` ;
962
+ in particular, you might want to pass configuration for footnotes if your
963
+ content is not in English;
964
964
the option ` allowDangerousHtml ` will always be set to ` true ` and the MDX
965
- nodes (see [ ` nodeTypes ` ] [ api-node-types ] ) are passed through;
966
- In particular, you might want to pass configuration for footnotes if your
967
- content is not in English
965
+ nodes (see [ ` nodeTypes ` ] [ api-node-types ] ) are passed through.
968
966
969
967
<details ><summary >Expand example</summary >
970
968
@@ -1096,8 +1094,10 @@ The processor goes through these steps:
1096
1094
7 . transform through recma (JS ecosystem)
1097
1095
8 . serialize esast as JavaScript
1098
1096
1099
- The * input* is MDX (serialized markdown with embedded JSX, ESM, and
1100
- expressions).
1097
+ The * input* is MDX.
1098
+ That’s serialized markdown with embedded JSX, ESM, and expressions.
1099
+ In the case of JSX,
1100
+ the tags are * intertwined* with markdown.
1101
1101
The markdown is parsed with [ ` micromark/micromark ` ] [ micromark ] and the embedded
1102
1102
JS with one of its extensions
1103
1103
[ ` micromark/micromark-extension-mdxjs ` ] [ micromark-extension-mdxjs ] (which in
@@ -1116,7 +1116,7 @@ respectively.
1116
1116
After markdown, we go to [ hast] [ ] (HTML).
1117
1117
This transformation is done by
1118
1118
[ ` syntax-tree/mdast-util-to-hast ` ] [ mdast-util-to-hast ] .
1119
- Wait, why, what is HTML needed?
1119
+ Wait, what, why is HTML needed?
1120
1120
Part of the reason is that we care about HTML semantics: we want to know that
1121
1121
something is an ` <a> ` , not whether it’s a link with a resource (` [text](url) ` )
1122
1122
or a reference to a defined link definition (` [text][id]\n\n[id]: url ` ).
@@ -1135,8 +1135,9 @@ Then we go to JavaScript: [esast][] (JS; an
1135
1135
AST which is compatible with estree but looks a bit more like other unist ASTs).
1136
1136
This transformation is done by
1137
1137
[ ` rehype-recma ` ] [ rehype-recma ] .
1138
- This is a new ecosystem that does not have utilities or plugins yet.
1139
- But it’s where ` @mdx-js/mdx ` does its thing: where it adds imports/exports,
1138
+ This is a newer ecosystem.
1139
+ There are some [ recma plugins] [ recma-plugins ] already.
1140
+ It’s where ` @mdx-js/mdx ` does its thing: where it adds imports/exports,
1140
1141
where it compiles JSX away into ` _jsx() ` calls, and where it does the other cool
1141
1142
things that it provides.
1142
1143
@@ -1263,6 +1264,8 @@ abide by its terms.
1263
1264
1264
1265
[ npm ] : https://docs.npmjs.com/cli/install
1265
1266
1267
+ [ recma-plugins ] : https://github.com/mdx-js/recma/blob/main/doc/plugins.md#list-of-plugins
1268
+
1266
1269
[ rehype-highlight ] : https://github.com/rehypejs/rehype-highlight
1267
1270
1268
1271
[ rehype-katex ] : https://github.com/remarkjs/remark-math/tree/main/packages/rehype-katex
0 commit comments