1
0
Fork 0
freesewing/packages/freesewing.shared/components/mdx/index.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-12-19 19:08:54 +01:00
import Popout from '../popout.js'
import Highlight from './highlight.js'
import YouTube from './youtube.js'
import Figure from './figure.js'
import ReadMore from './read-more.js'
import Example from './example/index.js'
import Dot from './dot.js'
import examples from '@freesewing/examples'
import rendertest from '@freesewing/rendertest'
import tutorial from '@freesewing/tutorial'
2021-12-19 19:08:54 +01:00
const mdxCustomComponents = (app, t) => ({
2021-12-19 19:08:54 +01:00
// Custom components
Example: props => <Example
{...props}
patterns={{examples, rendertest, tutorial}}
>{props.children}</Example>,
2021-12-28 12:24:24 +01:00
Comment: props => <Popout {...props} comment />,
2021-12-19 19:08:54 +01:00
Fixme: props => <Popout {...props} fixme />,
Link: props => <Popout {...props} link />,
Note: props => <Popout {...props} note />,
ReadMore: props => <ReadMore {...props} app={app} slug={app.slug} />,
2021-12-19 19:08:54 +01:00
Related: props => <Popout {...props} related />,
Tip: props => <Popout {...props} tip />,
Warning: props => <Popout {...props} warning />,
YouTube,
pre: props => <Highlight {...props} />,
2021-12-25 13:43:41 +01:00
img: Figure,
Dot,
2021-12-24 18:17:02 +01:00
})
2021-12-19 19:08:54 +01:00
export default mdxCustomComponents