1
1
mirror of https://github.com/primer/css.git synced 2024-12-02 16:13:02 +03:00
css/docs/markdown.js

27 lines
844 B
JavaScript
Raw Normal View History

2018-12-14 09:29:46 +03:00
import React from 'react'
2019-04-25 22:50:00 +03:00
import {Link} from '@primer/components'
import {MarkdownHeading} from '@primer/blueprints'
import {CodeExample} from '@primer/blueprints/next-components'
2019-04-25 22:50:00 +03:00
export const H1 = props => <MarkdownHeading {...props} />
export const H2 = props => <MarkdownHeading as="h2" {...props} />
export const H3 = props => <MarkdownHeading as="h3" {...props} />
export const H4 = props => <MarkdownHeading as="h4" {...props} />
export const H5 = props => <MarkdownHeading as="h5" {...props} />
2019-04-23 22:33:07 +03:00
export default function getComponents() {
return {
h1: H1,
2019-04-25 22:50:00 +03:00
h2: H2,
h3: H3,
h4: H4,
h5: H5,
// render links with our component
a: Link,
2019-03-01 01:58:25 +03:00
// render code blocks with our wrapper around react-live
2019-01-17 01:56:16 +03:00
code: CodeExample,
// "unwrap" <pre> elements around <code> blocks
pre: props => props.children
}
}