[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, ...
随机推荐
- node.js中常用的fs文件系统
fs文件系统模块对于系统文件及目录进行一些读写操作. 模块中的方法均有异步和同步版本,例如读取文件内容的函数有异步的 fs.readFile() 和同步的 fs.readFileSync(). 异步的 ...
- 【MySQL】可重复读模式下 unique key失效案例
一 [背景] 今天上午文能提笔安天下,武能上马定乾坤的登博给团队出了一道题目,谁先复现问题,奖励星巴克一杯.激起了一群忙碌的屌丝DBA的极大热情.问题是这样滴,如下图登博提示了几个细节: 1. ...
- 洛谷P3961 图的遍历
题目来源 做这道题的方法不少. 在这里我只提一种 就是大法师. 可以采用反向建边,从最大的点开始dfs 我们考虑每次从所剩点中最大的一个点出发,我们暂且称它为i,而凡是i这个点所能到达的点,可以到达的 ...
- python算法-插入排序
插入排序 一.核心思想:在一个有序的数组中,通过逐一和前面的数进行比较,找到新数的位置. 例子:数组有有一个数21 插入一个3,3<21,因此结果为 3,21 再插入一个34,34>21, ...
- 【LeetCode】Count and Say(报数)
这道题是LeetCode里的第38道题. 题目要求: 报数序列是一个整数序列,按照其中的整数的顺序进行报数,得到下一个数.其前五项如下: 1. 1 2. 11 3. 21 4. 1211 5. 111 ...
- HDU 3879 Base Station
Base Station Time Limit: 2000ms Memory Limit: 32768KB This problem will be judged on HDU. Original I ...
- 论文《Piexel Recurrent Nerual Network》总结
论文<Piexel Recurrent Nerual Network>总结 论文:<Pixel Recurrent Nerual Network> 时间:2016 作者:Aar ...
- HDU-5317 RGCDQ ,暴力打表!
RGCDQ 暴力水题,很可惜比赛时没有做出来,理清思路是很简单的. 题意:定义f(i)表示i的素因子个数,给你一段区间[l,r],求max_gcd(f(i),f(j)).具体细节参考题目. 思路:数据 ...
- SPOJ NSUBSTR Substrings ——后缀自动机
建后缀自动机 然后统计次数,只需要算出right集合的大小即可, 然后更新f[l[i]]和rit[i]取个max 然后根据rit集合短的一定包含长的的性质,从后往前更新一遍即可 #include &l ...
- 【SPOJ687&POJ3693】Maximum repetition substring(后缀数组)
题意: n<=1e5 思路: From http://hzwer.com/6152.html 往后匹配多远 r 用ST表求lcp即可...往前 l 就把串反过来再做一下.. 但是有可能求出来的最 ...