-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29dc2f1
commit 3547b64
Showing
10 changed files
with
59 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
'renoun': minor | ||
--- | ||
|
||
Exports the `parsePreProps` utility for the `CodeBlock` component instead of attaching it to the component itself: | ||
|
||
```tsx | ||
import { CodeBlock, parsePreProps } from 'renoun/components' | ||
import type { MDXComponents } from 'renoun/mdx' | ||
|
||
export function useMDXComponents() { | ||
return { | ||
pre: (props) => { | ||
return <CodeBlock {...parsePreProps(props)} /> | ||
}, | ||
} satisfies MDXComponents | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { CodeBlock, CodeInline, parseCodeProps } from 'renoun/components' | ||
import { | ||
CodeBlock, | ||
CodeInline, | ||
parsePreProps, | ||
parseCodeProps, | ||
} from 'renoun/components' | ||
import type { MDXComponents } from 'renoun/mdx' | ||
|
||
export function useMDXComponents() { | ||
return { | ||
pre: (props) => { | ||
return <CodeBlock {...parsePreProps(props)} /> | ||
}, | ||
code: (props) => { | ||
return <CodeInline {...parseCodeProps(props)} /> | ||
}, | ||
pre: (props) => { | ||
const { value, language } = CodeBlock.parsePreProps(props) | ||
return <CodeBlock value={value} language={language} /> | ||
}, | ||
} satisfies MDXComponents | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import { CodeBlock, CodeInline, parseCodeProps } from 'renoun/components' | ||
import { | ||
CodeBlock, | ||
CodeInline, | ||
parsePreProps, | ||
parseCodeProps, | ||
} from 'renoun/components' | ||
import type { MDXComponents } from 'renoun/mdx' | ||
|
||
export function useMDXComponents() { | ||
return { | ||
pre: (props) => { | ||
return <CodeBlock {...parsePreProps(props)} /> | ||
}, | ||
code: (props) => { | ||
return <CodeInline {...parseCodeProps(props)} /> | ||
}, | ||
pre: (props) => { | ||
return <CodeBlock {...CodeBlock.parsePreProps(props)} /> | ||
}, | ||
} satisfies MDXComponents | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export { | ||
CodeBlock, | ||
parsePreProps, | ||
type BaseCodeBlockProps, | ||
type CodeBlockProps, | ||
} from './CodeBlock.js' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters