Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a MarkdownProvider #46

Closed
johno opened this issue Feb 12, 2018 · 0 comments
Closed

Implement a MarkdownProvider #46

johno opened this issue Feb 12, 2018 · 0 comments

Comments

@johno
Copy link
Member

johno commented Feb 12, 2018

This will add a context that provides an element to component mapping, and any other globally available components.

As an example API, this will render Heading for the h1 element in readme.md.

import React from 'react'
import { MarkdownProvider } from '@compositor/markdown'

import { Heading } from './ui'

import Readme from './readme.md

export default () =>
  <MarkdownProvider components={{ h1: Heading }}>
    <Readme />
  </MarkdownProvider>
@johno johno closed this as completed Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant