JSPM

@rebass/markdown

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 167
    • Score
      100M100P100Q101653F
    • License MIT

    Rebass markdown component mapping

    Package Exports

    • @rebass/markdown

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rebass/markdown) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Rebass Markdown

    Rebass to HTML component mappings with smart defaults for use in markdown

    npm i @rebass/markdown

    Usage with MDX

    // example app provider component
    import React from 'react'
    import { MDXProvider } from '@mdx-js/tag'
    import { Provider as RebassProvider } from 'rebass'
    import createScope from '@rebass/markdown'
    
    const scope = createScope()
    
    export default props =>
      <MDXProvider components={scope}>
        <RebassProvider>
          {props.children}
        </RebassProvider>
      </MDXProvider>

    Options

    Rebass markdown can be customized by passing a props object. The props object should map to the tags used in markdown.

    const scope = createScope({
      // adds custom props to the h1 Heading component
      h1: {
        fontSize: [ 5, 6, 7 ],
        color: 'tomato'
      }
    })

    The following tags are used in Rebass Markdown:

    • h1
    • h2
    • h3
    • h4
    • h5
    • h6
    • p
    • a
    • img
    • hr
    • blockquote
    • pre
    • code
    • inlineCode
    • ul
    • li
    • table

    MIT License