[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 Provider
component 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, ...
随机推荐
- Shell脚本的条件测试与比较
Shell脚本的条件测试与比较 一.shell脚本的条件测试 通常,在bash的各种条件结构和流程控制结构中都要进行各种测试,然后根据测试结构执行不同的操作,有时也会与if等条件语句相结合,来完成测试 ...
- CSS3-盒模型-resize属性
作用:用来改变元素尺寸大小. 1.resize:none|both|horizontal|vertical|inherit none:不能拖动修改尺寸大小 both:可以拖动元素,修改元素宽高 hor ...
- lombok安装、配置、使用
eclipse安装Lombok 运行安装: java -jar ${path}\lombok.jar 选择IDE所在路径点击Install/Update即可使用. 手动安装1. 将lombok.jar ...
- javamail腾讯企业邮箱发送邮件
此代码用的jar文件:mail.jar(1.4.5版本); 如果jdk用的是1.8版本会出现SSL错误:这个问题是jdk导致的,jdk1.8里面有一个jce的包,安全性机制导致的访问https会报错, ...
- 【RAID】raid1 raid2 raid5 raid6 raid10的优缺点和做各自raid需要几块硬盘
Raid 0:一块硬盘或者以上就可做raid0优势:数据读取写入最快,最大优势提高硬盘容量,比如3快80G的硬盘做raid0 可用总容量为240G.速度是一样.缺点:无冗余能力,一块硬盘损坏,数据全无 ...
- kali2018利用ss和ProxyChains实现任意应用代理
第一步:配置ss 第二步:配置proxychain vim /etc/proxychains.conf 第三步:使用proxychains 终端输入: proxychains firefox 通过代理 ...
- sequence有关问题
sequence问题比如主键是 1,3,5,7,9,11 中间跳号了...用什么方法可以把主键重新排列为 1,2,3,4,5 ------解决方案--------------------update ...
- 新技术---- MongoDB
MongoDB 在 CentOS7 上安装 MongoDB-------https://www.linuxidc.com/Linux/2016-06/132675.htm Centos7 安装mong ...
- 安装oracle提示swap交换分区太小
1.用dd命令创建一个16G的文件 #dd if=/dev/zero of=/var/swapfile bs=1G count=16 2.将它创建为Linux Swap虚拟交换文件 #mkswap ...
- iOS转场动画初探
一般我们就用两种转场push和present present /** 1.设置代理 - (instancetype)init { self = [super init]; if (self) { se ...