zoukankan      html  css  js  c++  java
  • [MDX] Build a Custom Provider Component for MDX Deck

    MDX Deck is a great library for building slides using Markdown and JSX. Creating a custom Providercomponent allows you to change the markup of the entire deck. This lets you put things like logos and social media handles in each slide easily.

    In this lesson, you'll learn how to create a basic custom Provider that adds a Twitter handle to the bottom right corner of every slide.

    1. Create a Provider.js:

    import React from 'react'
    import ThemeProvider from 'mdx-deck/dist/Provider'
    
    const Provider = ({ children, ...rest }) => (
      <ThemeProvider {...rest}>
        {children}
    
        <div
          style={{
            position: 'absolute',
            bottom: '1em',
            right: '1em'
          }}
        >
          <a href="https://twitter.com/Zhentiw">
            @Zhentiw
          </a>
        </div>
      </ThemeProvider>
    )
    
    export default Provider

    2. Create a theme.js:

    import theme from 'mdx-deck/themes'
    import Provider from './Provider'
    
    export default {
      ...theme,
      Provider
    }

    3. Use it:

    export { default as theme } from './theme.js'
    
    # Step 1: Create a Custom Theme
    
    ---
    
    # Step 2: Create a Custom Provider
    
    ---
    
    # Step 3: Export Our Theme in the mdx-deck
  • 相关阅读:
    System.DateUtils 1. DateOf、TimeOf 简单修饰功能
    Servlet高级
    Servlet基础
    AOP的基本概念
    Bean的定义及作用域的注解实现
    Bean
    centos7系统下,配置学校客户端网络记录
    CUDA并行编程思维过程
    CUDA(GPU)OPENCV
    3-决策树
  • 原文地址:https://www.cnblogs.com/Answer1215/p/9893986.html
Copyright © 2011-2022 走看看