[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
[MDX] Build a Custom Provider Component for MDX Deck的更多相关文章
- UE4 Tutorial - Custom Mesh Component 用于绘制自定义网格的插件CustomMeshComponent
UE4 中用于绘制自定义网格的插件CustomMeshComponent. 转载: UE4 Tutorial - Custom Mesh Component Over the last few w ...
- [Recompose] Merge RxJS Button Event Streams to Build a React Counter Component
Combining input streams then using scan to track the results is a common scenario when coding with s ...
- [React] Validate Custom React Component Props with PropTypes
In this lesson we'll learn about how you can use the prop-types module to validate a custom React co ...
- [AngularFire2] Build a Custom Node Backend Using Firebase Queue
In this lesson we are going to learn how to build a custom Node process for batch processing of Fire ...
- [Angular] Implement a custom form component by using control value accessor
We have a form component: <label> <h3>Type</h3> <workout-type formControlName=& ...
- [原]how to view custom provider's events(collected without provider registered) by wpa
最近想使用etw作为高效的日志机制,也不想暴露机密信息(关键信息在msnifest文件中).也就是不能在客户机器上注册自己的provider,那需要manifest文件.这样采集回来的.etl文件如果 ...
- [React Native] Build a Github Repositories component
Nav to Repos component from Dashboard.js: goToRepos(){ api.getRepos(this.props.userInfo.login) .then ...
- [React Native] Build a Separator UI component
In this lesson we'll create a reusable React Native separator component which manages it's own style ...
- [Angular2 Form] Create custom form component using Control Value Accessor
//switch-control component import { Component } from '@angular/core'; import { ControlValueAccessor, ...
随机推荐
- 启动myeclipse出现JVM terminated. Exit code=-1
在启动myeclipse时出现如图: 解决方法 第一种: myeclipse.ini中内存设置过大导致 修改: 256m改成128m,512m 改为 256m. 第二种:在myeclipse.ini ...
- gnu printf可变参数宏
可变参数的宏 标准C只支持可变参数的函数,意味着函数的参数可以是不固定的 例如printf()函数的原型是int printf(const char *format [,argument]...) 而 ...
- CodeForces:699B-One Bomb
B. One Bomb time limit per test1 second memory limit per test256 megabytes Problem Description You a ...
- cs231n课程索引
课程资源 课程官网 课程视频-youtube 课程视频-字幕版 官方笔记 官方笔记-中文版 课程作业参考答案
- python库——h5py入门讲解
本文只是简单的对h5py库的基本创建文件,数据集和读取数据的方式进行介绍,作者刚接触h5py,完全靠看文档自学,如果哪里说的不对,欢迎纠正!如果读者需要进一步详细的学习h5py的更多知识,请参考h5p ...
- bluej
他山之石,可以攻玉!吾辈之道,披荆斩棘! 个人源码地址: https://gitee.com/blue_phantom
- iphone数据库(sqlite3)的用法操作oc,xcode
首先你在用之前要在项目中加入libsqlite3.dylib 1.定义模型 [cpp] #import <Foundation/Foundation.h> #import " ...
- Core Animation 动画
Core Animation框架 Core Animation可以作用与动画视图或者其他可视元素,为你完成了动画所需的大部分绘帧工作.你只需要配置少量的动画参数(如开始点的位置和结束点的位置)即可使用 ...
- FZU 2020 :组合 【lucas】
Problem Description 给出组合数C(n,m), 表示从n个元素中选出m个元素的方案数.例如C(5,2) = 10, C(4,2) = 6.可是当n,m比较大的时候,C(n,m)很大! ...
- mybatis学习(一)——mybatis简介
1.简介 MyBatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation 迁移到了google code,并且改名为MyBati ...