@astrojs/mdx 0.19.1 → 0.19.2

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.
Files changed (139) hide show
  1. package/package.json +8 -4
  2. package/.turbo/turbo-build.log +0 -4
  3. package/CHANGELOG.md +0 -725
  4. package/src/index.ts +0 -226
  5. package/src/plugins.ts +0 -185
  6. package/src/rehype-collect-headings.ts +0 -11
  7. package/src/rehype-meta-string.ts +0 -17
  8. package/src/remark-images-to-component.ts +0 -98
  9. package/src/remark-prism.ts +0 -18
  10. package/src/remark-shiki.ts +0 -115
  11. package/src/utils.ts +0 -108
  12. package/test/css-head-mdx.test.js +0 -98
  13. package/test/fixtures/css-head-mdx/node_modules/.bin/astro +0 -17
  14. package/test/fixtures/css-head-mdx/package.json +0 -10
  15. package/test/fixtures/css-head-mdx/src/components/BaseHead.astro +0 -11
  16. package/test/fixtures/css-head-mdx/src/components/BasicBlock.astro +0 -14
  17. package/test/fixtures/css-head-mdx/src/components/GenericComponent.astro +0 -1
  18. package/test/fixtures/css-head-mdx/src/components/HelloWorld.astro +0 -11
  19. package/test/fixtures/css-head-mdx/src/components/MDXWrapper.astro +0 -9
  20. package/test/fixtures/css-head-mdx/src/components/P.astro +0 -3
  21. package/test/fixtures/css-head-mdx/src/components/SmallCaps.astro +0 -3
  22. package/test/fixtures/css-head-mdx/src/components/UsingMdx.astro +0 -8
  23. package/test/fixtures/css-head-mdx/src/components/WithHoistedScripts.astro +0 -6
  24. package/test/fixtures/css-head-mdx/src/content/blog/_styles.css +0 -3
  25. package/test/fixtures/css-head-mdx/src/content/blog/using-mdx.mdx +0 -6
  26. package/test/fixtures/css-head-mdx/src/content/posts/test.mdx +0 -5
  27. package/test/fixtures/css-head-mdx/src/content/posts/using-component.mdx +0 -13
  28. package/test/fixtures/css-head-mdx/src/layouts/ContentLayout.astro +0 -18
  29. package/test/fixtures/css-head-mdx/src/layouts/DocumentLayout.astro +0 -15
  30. package/test/fixtures/css-head-mdx/src/layouts/One.astro +0 -15
  31. package/test/fixtures/css-head-mdx/src/layouts/Three.astro +0 -6
  32. package/test/fixtures/css-head-mdx/src/layouts/Two.astro +0 -6
  33. package/test/fixtures/css-head-mdx/src/pages/DirectContentUsage.astro +0 -17
  34. package/test/fixtures/css-head-mdx/src/pages/componentwithtext.mdx +0 -12
  35. package/test/fixtures/css-head-mdx/src/pages/indexOne.astro +0 -10
  36. package/test/fixtures/css-head-mdx/src/pages/indexThree.astro +0 -10
  37. package/test/fixtures/css-head-mdx/src/pages/indexTwo.astro +0 -10
  38. package/test/fixtures/css-head-mdx/src/pages/noLayoutWithComponent.mdx +0 -22
  39. package/test/fixtures/css-head-mdx/src/pages/posts/[post].astro +0 -18
  40. package/test/fixtures/css-head-mdx/src/pages/remote.astro +0 -17
  41. package/test/fixtures/css-head-mdx/src/pages/testOne.mdx +0 -15
  42. package/test/fixtures/css-head-mdx/src/pages/testThree.mdx +0 -15
  43. package/test/fixtures/css-head-mdx/src/pages/testTwo.mdx +0 -15
  44. package/test/fixtures/css-head-mdx/src/styles/global.css +0 -3
  45. package/test/fixtures/css-head-mdx/src/test.mdx +0 -14
  46. package/test/fixtures/mdx-astro-markdown-remarkRehype/src/pages/index.mdx +0 -5
  47. package/test/fixtures/mdx-component/src/components/Test.mdx +0 -3
  48. package/test/fixtures/mdx-component/src/components/WithFragment.mdx +0 -3
  49. package/test/fixtures/mdx-component/src/pages/glob.astro +0 -20
  50. package/test/fixtures/mdx-component/src/pages/index.astro +0 -5
  51. package/test/fixtures/mdx-component/src/pages/w-fragment.astro +0 -5
  52. package/test/fixtures/mdx-escape/src/components/Em.astro +0 -7
  53. package/test/fixtures/mdx-escape/src/components/P.astro +0 -1
  54. package/test/fixtures/mdx-escape/src/components/Title.astro +0 -1
  55. package/test/fixtures/mdx-escape/src/pages/html-tag.mdx +0 -5
  56. package/test/fixtures/mdx-escape/src/pages/index.mdx +0 -13
  57. package/test/fixtures/mdx-frontmatter/src/layouts/Base.astro +0 -38
  58. package/test/fixtures/mdx-frontmatter/src/pages/glob.json.js +0 -9
  59. package/test/fixtures/mdx-frontmatter/src/pages/index.mdx +0 -10
  60. package/test/fixtures/mdx-frontmatter/src/pages/with-headings.mdx +0 -7
  61. package/test/fixtures/mdx-frontmatter-injection/astro.config.mjs +0 -12
  62. package/test/fixtures/mdx-frontmatter-injection/node_modules/.bin/astro +0 -17
  63. package/test/fixtures/mdx-frontmatter-injection/package.json +0 -12
  64. package/test/fixtures/mdx-frontmatter-injection/src/layouts/Base.astro +0 -17
  65. package/test/fixtures/mdx-frontmatter-injection/src/markdown-plugins.mjs +0 -27
  66. package/test/fixtures/mdx-frontmatter-injection/src/pages/glob.json.js +0 -6
  67. package/test/fixtures/mdx-frontmatter-injection/src/pages/page-1.mdx +0 -8
  68. package/test/fixtures/mdx-frontmatter-injection/src/pages/page-2.mdx +0 -24
  69. package/test/fixtures/mdx-get-headings/src/pages/pages.json.js +0 -11
  70. package/test/fixtures/mdx-get-headings/src/pages/test-with-frontmatter.mdx +0 -45
  71. package/test/fixtures/mdx-get-headings/src/pages/test-with-jsx-expressions.mdx +0 -8
  72. package/test/fixtures/mdx-get-headings/src/pages/test.mdx +0 -9
  73. package/test/fixtures/mdx-get-static-paths/src/content/1.mdx +0 -5
  74. package/test/fixtures/mdx-get-static-paths/src/pages/[slug].astro +0 -34
  75. package/test/fixtures/mdx-images/astro.config.ts +0 -8
  76. package/test/fixtures/mdx-images/node_modules/.bin/astro +0 -17
  77. package/test/fixtures/mdx-images/package.json +0 -10
  78. package/test/fixtures/mdx-images/src/assets/houston in space.webp +0 -0
  79. package/test/fixtures/mdx-images/src/assets/houston.webp +0 -0
  80. package/test/fixtures/mdx-images/src/pages/index.mdx +0 -11
  81. package/test/fixtures/mdx-infinite-loop/astro.config.ts +0 -6
  82. package/test/fixtures/mdx-infinite-loop/node_modules/.bin/astro +0 -17
  83. package/test/fixtures/mdx-infinite-loop/package.json +0 -11
  84. package/test/fixtures/mdx-infinite-loop/src/components/Test.js +0 -3
  85. package/test/fixtures/mdx-infinite-loop/src/pages/doc.mdx +0 -6
  86. package/test/fixtures/mdx-infinite-loop/src/pages/index.astro +0 -5
  87. package/test/fixtures/mdx-math/src/pages/mathjax.mdx +0 -5
  88. package/test/fixtures/mdx-namespace/astro.config.mjs +0 -6
  89. package/test/fixtures/mdx-namespace/node_modules/.bin/astro +0 -17
  90. package/test/fixtures/mdx-namespace/package.json +0 -11
  91. package/test/fixtures/mdx-namespace/src/components/Component.jsx +0 -6
  92. package/test/fixtures/mdx-namespace/src/pages/object.mdx +0 -3
  93. package/test/fixtures/mdx-namespace/src/pages/star.mdx +0 -3
  94. package/test/fixtures/mdx-page/astro.config.ts +0 -5
  95. package/test/fixtures/mdx-page/node_modules/.bin/astro +0 -17
  96. package/test/fixtures/mdx-page/package.json +0 -10
  97. package/test/fixtures/mdx-page/src/pages/index.mdx +0 -3
  98. package/test/fixtures/mdx-page/src/styles.css +0 -3
  99. package/test/fixtures/mdx-plugins/src/pages/with-plugins.mdx +0 -25
  100. package/test/fixtures/mdx-plus-react/astro.config.mjs +0 -6
  101. package/test/fixtures/mdx-plus-react/node_modules/.bin/astro +0 -17
  102. package/test/fixtures/mdx-plus-react/package.json +0 -11
  103. package/test/fixtures/mdx-plus-react/src/components/Component.jsx +0 -5
  104. package/test/fixtures/mdx-plus-react/src/pages/index.astro +0 -11
  105. package/test/fixtures/mdx-script-style-raw/src/pages/index.mdx +0 -13
  106. package/test/fixtures/mdx-slots/src/components/Slotted.astro +0 -4
  107. package/test/fixtures/mdx-slots/src/components/Test.mdx +0 -15
  108. package/test/fixtures/mdx-slots/src/pages/glob.astro +0 -11
  109. package/test/fixtures/mdx-slots/src/pages/index.astro +0 -5
  110. package/test/fixtures/mdx-syntax-hightlighting/src/pages/index.mdx +0 -9
  111. package/test/fixtures/mdx-url-export/src/pages/pages.json.js +0 -9
  112. package/test/fixtures/mdx-url-export/src/pages/test-1.mdx +0 -1
  113. package/test/fixtures/mdx-url-export/src/pages/test-2.mdx +0 -1
  114. package/test/fixtures/mdx-url-export/src/pages/with-url-override.mdx +0 -3
  115. package/test/fixtures/mdx-vite-env-vars/astro.config.mjs +0 -9
  116. package/test/fixtures/mdx-vite-env-vars/node_modules/.bin/astro +0 -17
  117. package/test/fixtures/mdx-vite-env-vars/package.json +0 -8
  118. package/test/fixtures/mdx-vite-env-vars/src/pages/frontmatter.json.js +0 -7
  119. package/test/fixtures/mdx-vite-env-vars/src/pages/vite-env-vars.mdx +0 -38
  120. package/test/mdx-astro-markdown-remarkRehype.test.js +0 -85
  121. package/test/mdx-component.test.js +0 -191
  122. package/test/mdx-escape.test.js +0 -32
  123. package/test/mdx-frontmatter-injection.test.js +0 -53
  124. package/test/mdx-frontmatter.test.js +0 -77
  125. package/test/mdx-get-headings.test.js +0 -194
  126. package/test/mdx-get-static-paths.test.js +0 -32
  127. package/test/mdx-images.test.js +0 -40
  128. package/test/mdx-infinite-loop.test.js +0 -30
  129. package/test/mdx-math.test.js +0 -64
  130. package/test/mdx-namespace.test.js +0 -83
  131. package/test/mdx-page.test.js +0 -64
  132. package/test/mdx-plugins.test.js +0 -285
  133. package/test/mdx-plus-react.test.js +0 -25
  134. package/test/mdx-script-style-raw.test.js +0 -70
  135. package/test/mdx-slots.js +0 -124
  136. package/test/mdx-syntax-highlighting.test.js +0 -145
  137. package/test/mdx-url-export.test.js +0 -28
  138. package/test/mdx-vite-env-vars.test.js +0 -54
  139. package/tsconfig.json +0 -10
@@ -1,5 +0,0 @@
1
- ---
2
- import Test from '../components/Test.mdx';
3
- ---
4
-
5
- <Test />
@@ -1,5 +0,0 @@
1
- ---
2
- import WithFragment from '../components/WithFragment.mdx';
3
- ---
4
-
5
- <WithFragment />
@@ -1,7 +0,0 @@
1
- <em><slot/></em>
2
-
3
- <style>
4
- em {
5
- color: red;
6
- }
7
- </style>
@@ -1 +0,0 @@
1
- <p><slot /></p>
@@ -1 +0,0 @@
1
- <h1><slot/></h1>
@@ -1,5 +0,0 @@
1
- import P from '../components/P.astro';
2
- import Em from '../components/Em.astro';
3
-
4
- <P>Render <Em>Me</Em></P>
5
- <P><Em>Me</Em></P>
@@ -1,13 +0,0 @@
1
- import P from '../components/P.astro';
2
- import Em from '../components/Em.astro';
3
- import Title from '../components/Title.astro';
4
-
5
- export const components = { p: P, em: Em, h1: Title };
6
-
7
- # Hello _there_
8
-
9
- # _there_
10
-
11
- Hello _there_
12
-
13
- _there_
@@ -1,38 +0,0 @@
1
- ---
2
- const {
3
- content = { title: "content didn't work" },
4
- file = "file didn't work",
5
- url = "url didn't work",
6
- frontmatter = {
7
- title: "frontmatter didn't work",
8
- file: "file didn't work",
9
- url: "url didn't work",
10
- },
11
- headings = [],
12
- } = Astro.props;
13
- ---
14
-
15
- <!DOCTYPE html>
16
- <html lang="en">
17
-
18
- <head>
19
- <meta charset="UTF-8">
20
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
21
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
22
- </head>
23
-
24
- <body>
25
- <p data-content-title>{content.title}</p>
26
- <p data-frontmatter-title>{frontmatter.title}</p>
27
- <p data-frontmatter-file>{frontmatter.file}</p>
28
- <p data-frontmatter-url>{frontmatter.url}</p>
29
- <p data-file>{frontmatter.file}</p>
30
- <p data-url>{frontmatter.url}</p>
31
- <p data-layout-rendered>Layout rendered!</p>
32
- <ul data-headings>
33
- {headings.map(heading => <li>{heading.slug}</li>)}
34
- </ul>
35
- <slot />
36
- </body>
37
-
38
- </html>
@@ -1,9 +0,0 @@
1
- export async function get() {
2
- const mdxPages = await import.meta.glob('./*.mdx', { eager: true });
3
-
4
- return {
5
- body: JSON.stringify({
6
- titles: Object.values(mdxPages ?? {}).map(v => v?.frontmatter?.title),
7
- })
8
- }
9
- }
@@ -1,10 +0,0 @@
1
- ---
2
- title: 'Using YAML frontmatter'
3
- layout: '../layouts/Base.astro'
4
- illThrowIfIDontExist: "Oh no, that's scary!"
5
- ---
6
-
7
- {frontmatter.illThrowIfIDontExist}
8
-
9
- > Note: newline intentionally missing from the end of this file.
10
- > Useful since that can be the source of bugs in our compile step.
@@ -1,7 +0,0 @@
1
- ---
2
- layout: '../layouts/Base.astro'
3
- ---
4
-
5
- ## Section 1
6
-
7
- ## Section 2
@@ -1,12 +0,0 @@
1
- import { defineConfig } from 'astro/config';
2
- import mdx from '@astrojs/mdx';
3
- import { rehypeReadingTime, remarkDescription, remarkTitle } from './src/markdown-plugins.mjs';
4
-
5
- // https://astro.build/config
6
- export default defineConfig({
7
- site: 'https://astro.build/',
8
- integrations: [mdx({
9
- remarkPlugins: [remarkTitle, remarkDescription],
10
- rehypePlugins: [rehypeReadingTime],
11
- })],
12
- });
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../../../astro/astro.js" "$@"
15
- else
16
- exec node "$basedir/../../../../../../../astro/astro.js" "$@"
17
- fi
@@ -1,12 +0,0 @@
1
- {
2
- "name": "@test/mdx-frontmatter-injection",
3
- "version": "0.0.0",
4
- "private": true,
5
- "dependencies": {
6
- "astro": "workspace:*",
7
- "@astrojs/mdx": "workspace:*",
8
- "mdast-util-to-string": "^3.1.0",
9
- "reading-time": "^1.5.0",
10
- "unist-util-visit": "^4.1.0"
11
- }
12
- }
@@ -1,17 +0,0 @@
1
- ---
2
- const defaults = { title: 'Frontmatter not passed to layout!' }
3
- const { frontmatter = defaults, content = defaults } = Astro.props;
4
- ---
5
-
6
- <!DOCTYPE html>
7
- <html lang="en">
8
- <head>
9
- <meta charset="UTF-8">
10
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
11
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
12
- <title>{frontmatter.title}</title>
13
- </head>
14
- <body>
15
- <slot />
16
- </body>
17
- </html>
@@ -1,27 +0,0 @@
1
- import getReadingTime from 'reading-time';
2
- import { toString } from 'mdast-util-to-string';
3
- import { visit } from 'unist-util-visit';
4
-
5
- export function rehypeReadingTime() {
6
- return function (tree, { data }) {
7
- const readingTime = getReadingTime(toString(tree));
8
- data.astro.frontmatter.injectedReadingTime = readingTime;
9
- };
10
- }
11
-
12
- export function remarkTitle() {
13
- return function (tree, { data }) {
14
- visit(tree, ['heading'], (node) => {
15
- if (node.depth === 1) {
16
- data.astro.frontmatter.title = toString(node.children);
17
- }
18
- });
19
- };
20
- }
21
-
22
- export function remarkDescription() {
23
- return function (tree, vfile) {
24
- const { frontmatter } = vfile.data.astro;
25
- frontmatter.description = `Processed by remarkDescription plugin: ${frontmatter.description}`
26
- };
27
- }
@@ -1,6 +0,0 @@
1
- export async function get() {
2
- const docs = await import.meta.glob('./*.mdx', { eager: true });
3
- return {
4
- body: JSON.stringify(Object.values(docs).map(doc => doc.frontmatter)),
5
- }
6
- }
@@ -1,8 +0,0 @@
1
- ---
2
- layout: '../layouts/Base.astro'
3
- description: Page 1 description
4
- ---
5
-
6
- # Page 1
7
-
8
- Look at that!
@@ -1,24 +0,0 @@
1
- ---
2
- layout: '../layouts/Base.astro'
3
- description: Page 2 description
4
- ---
5
-
6
- # Page 2
7
-
8
- ## Table of contents
9
-
10
- ## Section 1
11
-
12
- Some text!
13
-
14
- ### Subsection 1
15
-
16
- Some subsection test!
17
-
18
- ### Subsection 2
19
-
20
- Oh cool, more text!
21
-
22
- ## Section 2
23
-
24
- More content
@@ -1,11 +0,0 @@
1
- export async function get() {
2
- const mdxPages = await import.meta.glob('./*.mdx', { eager: true });
3
-
4
- return {
5
- body: JSON.stringify({
6
- headingsByPage: Object.fromEntries(
7
- Object.entries(mdxPages ?? {}).map(([k, v]) => [k, v?.getHeadings()])
8
- ),
9
- }),
10
- }
11
- }
@@ -1,45 +0,0 @@
1
- ---
2
- title: The Frontmatter Title
3
- keywords: [Keyword 1, Keyword 2, Keyword 3]
4
- tags:
5
- - Tag 1
6
- - Tag 2
7
- - Tag 3
8
- items:
9
- - value: Item 1
10
- - value: Item 2
11
- - value: Item 3
12
- nested_items:
13
- nested:
14
- - value: Nested Item 1
15
- - value: Nested Item 2
16
- - value: Nested Item 3
17
- ---
18
-
19
- # {frontmatter.title}
20
-
21
- This ID should be the frontmatter title.
22
-
23
- ## frontmatter.title
24
-
25
- The ID should not be the frontmatter title.
26
-
27
- ### {frontmatter.keywords[1]}
28
-
29
- The ID should be the frontmatter keyword #2.
30
-
31
- ### {frontmatter.tags[0]}
32
-
33
- The ID should be the frontmatter tag #1.
34
-
35
- #### {frontmatter.items[1].value}
36
-
37
- The ID should be the frontmatter item #2.
38
-
39
- ##### {frontmatter.nested_items.nested[2].value}
40
-
41
- The ID should be the frontmatter nested item #3.
42
-
43
- ###### {frontmatter.unknown}
44
-
45
- This ID should not reference the frontmatter.
@@ -1,8 +0,0 @@
1
- export const h2Title = "Section 1"
2
- export const h3Title = "Subsection 1"
3
-
4
- # Heading test with JSX expressions
5
-
6
- ## {h2Title}
7
-
8
- ### {h3Title}
@@ -1,9 +0,0 @@
1
- # Heading test
2
-
3
- ## Section 1
4
-
5
- ### Subsection 1
6
-
7
- ### Subsection 2
8
-
9
- ## Section 2
@@ -1,5 +0,0 @@
1
- ---
2
- one: hello
3
- slug: one
4
- ---
5
- First mdx file
@@ -1,34 +0,0 @@
1
- ---
2
- export const getStaticPaths = async () => {
3
- const content = await Astro.glob('../content/*.mdx');
4
-
5
- return content
6
- .filter((page) => !page.frontmatter.draft) // skip drafts
7
- .map(({ default: MdxContent, frontmatter, url, file }) => {
8
- return {
9
- params: { slug: frontmatter.slug || "index" },
10
- props: {
11
- MdxContent,
12
- file,
13
- frontmatter,
14
- url
15
- }
16
- }
17
- })
18
- }
19
-
20
- const { MdxContent, frontmatter, url, file } = Astro.props;
21
- ---
22
-
23
- <html>
24
- <head>
25
- <title>Page</title>
26
- </head>
27
- <body>
28
- <MdxContent />
29
-
30
- <div id="one">{frontmatter.one}</div>
31
- <div id="url">{url}</div>
32
- <div id="file">{file}</div>
33
- </body>
34
- </html>
@@ -1,8 +0,0 @@
1
- import mdx from '@astrojs/mdx';
2
-
3
- export default {
4
- integrations: [mdx()],
5
- experimental: {
6
- assets: true
7
- }
8
- }
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../../../astro/astro.js" "$@"
15
- else
16
- exec node "$basedir/../../../../../../../astro/astro.js" "$@"
17
- fi
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@test/mdx-images",
3
- "private": true,
4
- "dependencies": {
5
- "@astrojs/mdx": "workspace:*",
6
- "astro": "workspace:*",
7
- "react": "^18.2.0",
8
- "react-dom": "^18.2.0"
9
- }
10
- }
@@ -1,11 +0,0 @@
1
- Image using a relative path:
2
- ![Houston](../assets/houston.webp)
3
-
4
- Image using an aliased path:
5
- ![Houston](~/assets/houston.webp)
6
-
7
- Image with a title:
8
- ![Houston](~/assets/houston.webp "Houston title")
9
-
10
- Image with spaces in the path:
11
- ![Houston](<~/assets/houston in space.webp>)
@@ -1,6 +0,0 @@
1
- import mdx from '@astrojs/mdx';
2
- import preact from '@astrojs/preact';
3
-
4
- export default {
5
- integrations: [mdx(), preact()]
6
- }
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../../../astro/astro.js" "$@"
15
- else
16
- exec node "$basedir/../../../../../../../astro/astro.js" "$@"
17
- fi
@@ -1,11 +0,0 @@
1
- {
2
- "name": "@test/mdx-infinite-loop",
3
- "type": "module",
4
- "private": true,
5
- "dependencies": {
6
- "@astrojs/mdx": "workspace:*",
7
- "@astrojs/preact": "workspace:*",
8
- "preact": "^10.7.3",
9
- "astro": "workspace:*"
10
- }
11
- }
@@ -1,3 +0,0 @@
1
- export default function () {
2
- return 'Hello world'
3
- }
@@ -1,6 +0,0 @@
1
- import Test, { Missing } from '../components/Test';
2
-
3
- # Hello page!
4
-
5
- <Test />
6
- <Missing />
@@ -1,5 +0,0 @@
1
- ---
2
- const files = await Astro.glob('./**/*.mdx')
3
- ---
4
-
5
- {files.map((file: any) => <file.Content />)}
@@ -1,5 +0,0 @@
1
- # Mathjax
2
-
3
- $$
4
- \left(\frac{\sqrt{x+2}}{y^{2}}\right)
5
- $$
@@ -1,6 +0,0 @@
1
- import mdx from '@astrojs/mdx';
2
- import react from '@astrojs/react';
3
-
4
- export default {
5
- integrations: [react(), mdx()]
6
- }
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../../../astro/astro.js" "$@"
15
- else
16
- exec node "$basedir/../../../../../../../astro/astro.js" "$@"
17
- fi
@@ -1,11 +0,0 @@
1
- {
2
- "name": "@test/mdx-namespace",
3
- "private": true,
4
- "dependencies": {
5
- "@astrojs/mdx": "workspace:*",
6
- "@astrojs/react": "workspace:*",
7
- "astro": "workspace:*",
8
- "react": "^18.2.0",
9
- "react-dom": "^18.1.0"
10
- }
11
- }
@@ -1,6 +0,0 @@
1
- const Component = () => {
2
- return <p id="component">Hello world</p>;
3
- };
4
- export const ns = {
5
- Component
6
- }
@@ -1,3 +0,0 @@
1
- import * as mod from '../components/Component.jsx';
2
-
3
- <mod.ns.Component client:load />
@@ -1,3 +0,0 @@
1
- import { ns } from '../components/Component.jsx';
2
-
3
- <ns.Component client:load />
@@ -1,5 +0,0 @@
1
- import mdx from '@astrojs/mdx';
2
-
3
- export default {
4
- integrations: [mdx()]
5
- }
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
10
- else
11
- export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules:$NODE_PATH"
12
- fi
13
- if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../../../astro/astro.js" "$@"
15
- else
16
- exec node "$basedir/../../../../../../../astro/astro.js" "$@"
17
- fi
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@test/mdx-page",
3
- "private": true,
4
- "dependencies": {
5
- "@astrojs/mdx": "workspace:*",
6
- "astro": "workspace:*",
7
- "react": "^18.2.0",
8
- "react-dom": "^18.2.0"
9
- }
10
- }
@@ -1,3 +0,0 @@
1
- import '../styles.css'
2
-
3
- # Hello page!
@@ -1,3 +0,0 @@
1
- p {
2
- color: red;
3
- }
@@ -1,25 +0,0 @@
1
- export let recmaPluginWorking = false
2
-
3
- # TOC test
4
-
5
- ## Table of contents
6
-
7
- ## Section 1
8
-
9
- Some text!
10
-
11
- ### Subsection 1
12
-
13
- Some subsection test!
14
-
15
- ### Subsection 2
16
-
17
- Oh cool, more text!
18
-
19
- ## Section 2
20
-
21
- And section 2, with a hyperlink to check GFM is preserved: https://handle-me-gfm.com
22
-
23
- <div data-recma-plugin-works={recmaPluginWorking}></div>
24
-
25
- > "Smartypants" is -- awesome
@@ -1,6 +0,0 @@
1
- import mdx from '@astrojs/mdx';
2
- import react from '@astrojs/react';
3
-
4
- export default {
5
- integrations: [react(), mdx()]
6
- }