Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 9f13ce8

Browse files
committed
feat(mdx-loader): implement account syntax
fixes: #396
1 parent af8540c commit 9f13ce8

File tree

20 files changed

+1560
-31
lines changed

20 files changed

+1560
-31
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,9 @@ The following properties are provided, but you can change the css directly if yo
162162
--h6-font-size: 2rem;
163163
--h6-font-weight: 600;
164164

165+
--account-icon-size: 3rem;
166+
--account-icon-color: #545454;
165167
--code-font-size: 1.8rem;
166-
167168
--qr-code-image-size: 320px;
168169
}
169170
```

packages/client/assets/style/customize.css

+7-6
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@
5353
pointer-events: none;
5454
}
5555

56-
/* @media (--viewport-not-pc) {
57-
.slide-internal-box {
58-
align-self: flex-start;
59-
}
60-
} */
61-
6256
.katex-html {
6357
display: none;
6458
}
@@ -72,3 +66,10 @@
7266
.mermaid {
7367
width: 100%;
7468
}
69+
70+
.account {
71+
color: var(--account-icon-color);
72+
font-size: var(--account-icon-size);
73+
display: flex;
74+
align-items: center;
75+
}

packages/client/assets/style/variables.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
--h6-font-size: 2rem;
2626
--h6-font-weight: 600;
2727

28+
--account-icon-size: 3rem;
29+
--account-icon-color: #545454;
2830
--code-font-size: 1.8rem;
29-
3031
--qr-code-image-size: 320px;
3132
}
3233

packages/client/src/components/Assistant.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,8 @@ export const Assistant = () => (
174174
url: 'https://hiroppy.github.io/fusuma/intro/#slide-13',
175175
},
176176
{
177-
title: 'Capturing Screen Contents',
178-
content: <code>screen</code>,
179-
url: 'https://hiroppy.github.io/fusuma/intro/#slide-14',
177+
title: 'Generating SNS icon',
178+
content: <code>{`account: serviceName, yourName, text`}</code>,
180179
},
181180
{
182181
title: 'Generating QR Code',

packages/fusuma/src/configs/templates/0-slide.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
# Hello😃
44

5+
<!-- block-start: grid -->
6+
<!-- account: twitter, your-account-name -->
7+
<!-- block-end -->
8+
59
---
610

711
<!-- section-title: Bye👋 -->

packages/fusuma/src/configs/templates/style.css

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/* --h2-font-size: 4rem; */
2323
/* --h3-font-size: 3.6rem; */
2424
/* --code-font-size: 1.8rem; */
25+
/* --account-icon-size: 3rem; */
2526
/* } */
2627

2728
.title {

packages/mdx-loader/__tests__/__snapshots__/index.js.snap

+83-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ exports[`fusuma-loader should add background to props 1`] = `
66

77
import React from 'react';
88
import { mdx } from '@mdx-js/react';
9+
import * as Client from '@fusuma/client';
10+
import * as Icons from 'react-icons/fa';
911
export const slides = [props => <>
1012

1113

@@ -41,6 +43,8 @@ exports[`fusuma-loader should add background(url) to props 1`] = `
4143

4244
import React from 'react';
4345
import { mdx } from '@mdx-js/react';
46+
import * as Client from '@fusuma/client';
47+
import * as Icons from 'react-icons/fa';
4448
export const slides = [props => <>
4549

4650

@@ -76,6 +80,8 @@ exports[`fusuma-loader should add data-line to pre tag 1`] = `
7680

7781
import React from 'react';
7882
import { mdx } from '@mdx-js/react';
83+
import * as Client from '@fusuma/client';
84+
import * as Icons from 'react-icons/fa';
7985
export const slides = [props => <>
8086

8187
<pre data-line=\\"5\\"><code parentName=\\"pre\\" {...{
@@ -130,9 +136,9 @@ exports[`fusuma-loader should add fragments 1`] = `
130136
/* @jsx mdx */
131137

132138
import React from 'react';
133-
import { mdx } from '@mdx-js/react'; // don't import as named to avoid using makeShortcode by mdx
134-
139+
import { mdx } from '@mdx-js/react';
135140
import * as Client from '@fusuma/client';
141+
import * as Icons from 'react-icons/fa';
136142
export const slides = [props => <>
137143

138144
<Client.Fragments id={0.05072298324733815}>
@@ -180,6 +186,8 @@ exports[`fusuma-loader should add fusuma options 1`] = `
180186

181187
import React from 'react';
182188
import { mdx } from '@mdx-js/react';
189+
import * as Client from '@fusuma/client';
190+
import * as Icons from 'react-icons/fa';
183191
export const slides = [props => <>
184192

185193
<h1>{\`Hello\`}</h1>
@@ -233,12 +241,63 @@ export default function MDXContent({
233241
MDXContent.isMDXComponent = true;"
234242
`;
235243

244+
exports[`fusuma-loader should add sns accounts 1`] = `
245+
"/* @jsxRuntime classic */
246+
/* @jsx mdx */
247+
248+
import React from 'react';
249+
import { mdx } from '@mdx-js/react';
250+
import * as Client from '@fusuma/client';
251+
import * as Icons from 'react-icons/fa';
252+
export const slides = [props => <>
253+
254+
<a href=\\"https://twitter.com/name\\" className=\\"account account-twitter\\"><Icons.FaTwitter />hello</a>
255+
<a href=\\"https://github.com/name\\" className=\\"account account-github\\"><Icons.FaGithub />bye</a>
256+
<a href=\\"https://www.facebook.com/name\\" className=\\"account account-facebook\\"><Icons.FaFacebook />hello</a>
257+
<a href=\\"https://www.linkedin.com/in/name\\" className=\\"account account-linkedin\\"><Icons.FaLinkedin />bye</a>
258+
259+
</>];
260+
export const backgrounds = [0];
261+
export const fragmentSteps = [0];
262+
export const fusumaProps = [{}];
263+
264+
const layoutProps = {
265+
266+
};
267+
const MDXLayout = \\"wrapper\\"
268+
export default function MDXContent({
269+
components,
270+
...props
271+
}) {
272+
return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\\"MDXLayout\\">
273+
{
274+
/* account: twitter, name, hello */
275+
}
276+
{
277+
/* account: github, name, bye */
278+
}
279+
{
280+
/* account: facebook, name, hello */
281+
}
282+
{
283+
/* account: linkedin, name, bye */
284+
}
285+
286+
</MDXLayout>;
287+
}
288+
289+
;
290+
MDXContent.isMDXComponent = true;"
291+
`;
292+
236293
exports[`fusuma-loader should append div tag by block comment 1`] = `
237294
"/* @jsxRuntime classic */
238295
/* @jsx mdx */
239296

240297
import React from 'react';
241298
import { mdx } from '@mdx-js/react';
299+
import * as Client from '@fusuma/client';
300+
import * as Icons from 'react-icons/fa';
242301
export const slides = [props => <>
243302

244303
<div>
@@ -304,6 +363,8 @@ exports[`fusuma-loader should append executable code components 1`] = `
304363

305364
import React from 'react';
306365
import { mdx } from '@mdx-js/react';
366+
import * as Client from '@fusuma/client';
367+
import * as Icons from 'react-icons/fa';
307368
export const slides = [props => <>
308369

309370
<div className=\\"executable-code-container\\">
@@ -360,6 +421,8 @@ exports[`fusuma-loader should convert MathJax 1`] = `
360421

361422
import React from 'react';
362423
import { mdx } from '@mdx-js/react';
424+
import * as Client from '@fusuma/client';
425+
import * as Icons from 'react-icons/fa';
363426
export const slides = [props => <>
364427

365428
<h1>{\`MathJax\`}</h1>
@@ -697,6 +760,8 @@ exports[`fusuma-loader should convert QRCode 1`] = `
697760

698761
import React from 'react';
699762
import { mdx } from '@mdx-js/react';
763+
import * as Client from '@fusuma/client';
764+
import * as Icons from 'react-icons/fa';
700765
export const slides = [props => <>
701766

702767
<svg className=\\"qr\\" version=\\"1.1\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"66px\\" height=\\"66px\\" viewBox=\\"0 0 66 66\\" preserveAspectRatio=\\"xMinYMin meet\\"><rect width=\\"100%\\" height=\\"100%\\" fill=\\"white\\" cx=\\"0\\" cy=\\"0\\" /><path d=\\"M8,8l2,0 0,2 -2,0 0,-2z M10,8l2,0 0,2 -2,0 0,-2z M12,8l2,0 0,2 -2,0 0,-2z M14,8l2,0 0,2 -2,0 0,-2z M16,8l2,0 0,2 -2,0 0,-2z M18,8l2,0 0,2 -2,0 0,-2z M20,8l2,0 0,2 -2,0 0,-2z M24,8l2,0 0,2 -2,0 0,-2z M26,8l2,0 0,2 -2,0 0,-2z M28,8l2,0 0,2 -2,0 0,-2z M30,8l2,0 0,2 -2,0 0,-2z M36,8l2,0 0,2 -2,0 0,-2z M44,8l2,0 0,2 -2,0 0,-2z M46,8l2,0 0,2 -2,0 0,-2z M48,8l2,0 0,2 -2,0 0,-2z M50,8l2,0 0,2 -2,0 0,-2z M52,8l2,0 0,2 -2,0 0,-2z M54,8l2,0 0,2 -2,0 0,-2z M56,8l2,0 0,2 -2,0 0,-2z M8,10l2,0 0,2 -2,0 0,-2z M20,10l2,0 0,2 -2,0 0,-2z M30,10l2,0 0,2 -2,0 0,-2z M32,10l2,0 0,2 -2,0 0,-2z M34,10l2,0 0,2 -2,0 0,-2z M40,10l2,0 0,2 -2,0 0,-2z M44,10l2,0 0,2 -2,0 0,-2z M56,10l2,0 0,2 -2,0 0,-2z M8,12l2,0 0,2 -2,0 0,-2z M12,12l2,0 0,2 -2,0 0,-2z M14,12l2,0 0,2 -2,0 0,-2z M16,12l2,0 0,2 -2,0 0,-2z M20,12l2,0 0,2 -2,0 0,-2z M26,12l2,0 0,2 -2,0 0,-2z M30,12l2,0 0,2 -2,0 0,-2z M34,12l2,0 0,2 -2,0 0,-2z M36,12l2,0 0,2 -2,0 0,-2z M44,12l2,0 0,2 -2,0 0,-2z M48,12l2,0 0,2 -2,0 0,-2z M50,12l2,0 0,2 -2,0 0,-2z M52,12l2,0 0,2 -2,0 0,-2z M56,12l2,0 0,2 -2,0 0,-2z M8,14l2,0 0,2 -2,0 0,-2z M12,14l2,0 0,2 -2,0 0,-2z M14,14l2,0 0,2 -2,0 0,-2z M16,14l2,0 0,2 -2,0 0,-2z M20,14l2,0 0,2 -2,0 0,-2z M28,14l2,0 0,2 -2,0 0,-2z M30,14l2,0 0,2 -2,0 0,-2z M36,14l2,0 0,2 -2,0 0,-2z M38,14l2,0 0,2 -2,0 0,-2z M40,14l2,0 0,2 -2,0 0,-2z M44,14l2,0 0,2 -2,0 0,-2z M48,14l2,0 0,2 -2,0 0,-2z M50,14l2,0 0,2 -2,0 0,-2z M52,14l2,0 0,2 -2,0 0,-2z M56,14l2,0 0,2 -2,0 0,-2z M8,16l2,0 0,2 -2,0 0,-2z M12,16l2,0 0,2 -2,0 0,-2z M14,16l2,0 0,2 -2,0 0,-2z M16,16l2,0 0,2 -2,0 0,-2z M20,16l2,0 0,2 -2,0 0,-2z M28,16l2,0 0,2 -2,0 0,-2z M30,16l2,0 0,2 -2,0 0,-2z M32,16l2,0 0,2 -2,0 0,-2z M34,16l2,0 0,2 -2,0 0,-2z M36,16l2,0 0,2 -2,0 0,-2z M40,16l2,0 0,2 -2,0 0,-2z M44,16l2,0 0,2 -2,0 0,-2z M48,16l2,0 0,2 -2,0 0,-2z M50,16l2,0 0,2 -2,0 0,-2z M52,16l2,0 0,2 -2,0 0,-2z M56,16l2,0 0,2 -2,0 0,-2z M8,18l2,0 0,2 -2,0 0,-2z M20,18l2,0 0,2 -2,0 0,-2z M26,18l2,0 0,2 -2,0 0,-2z M30,18l2,0 0,2 -2,0 0,-2z M34,18l2,0 0,2 -2,0 0,-2z M36,18l2,0 0,2 -2,0 0,-2z M44,18l2,0 0,2 -2,0 0,-2z M56,18l2,0 0,2 -2,0 0,-2z M8,20l2,0 0,2 -2,0 0,-2z M10,20l2,0 0,2 -2,0 0,-2z M12,20l2,0 0,2 -2,0 0,-2z M14,20l2,0 0,2 -2,0 0,-2z M16,20l2,0 0,2 -2,0 0,-2z M18,20l2,0 0,2 -2,0 0,-2z M20,20l2,0 0,2 -2,0 0,-2z M24,20l2,0 0,2 -2,0 0,-2z M28,20l2,0 0,2 -2,0 0,-2z M32,20l2,0 0,2 -2,0 0,-2z M36,20l2,0 0,2 -2,0 0,-2z M40,20l2,0 0,2 -2,0 0,-2z M44,20l2,0 0,2 -2,0 0,-2z M46,20l2,0 0,2 -2,0 0,-2z M48,20l2,0 0,2 -2,0 0,-2z M50,20l2,0 0,2 -2,0 0,-2z M52,20l2,0 0,2 -2,0 0,-2z M54,20l2,0 0,2 -2,0 0,-2z M56,20l2,0 0,2 -2,0 0,-2z M24,22l2,0 0,2 -2,0 0,-2z M26,22l2,0 0,2 -2,0 0,-2z M32,22l2,0 0,2 -2,0 0,-2z M36,22l2,0 0,2 -2,0 0,-2z M38,22l2,0 0,2 -2,0 0,-2z M8,24l2,0 0,2 -2,0 0,-2z M10,24l2,0 0,2 -2,0 0,-2z M14,24l2,0 0,2 -2,0 0,-2z M16,24l2,0 0,2 -2,0 0,-2z M20,24l2,0 0,2 -2,0 0,-2z M26,24l2,0 0,2 -2,0 0,-2z M32,24l2,0 0,2 -2,0 0,-2z M34,24l2,0 0,2 -2,0 0,-2z M36,24l2,0 0,2 -2,0 0,-2z M38,24l2,0 0,2 -2,0 0,-2z M40,24l2,0 0,2 -2,0 0,-2z M44,24l2,0 0,2 -2,0 0,-2z M56,24l2,0 0,2 -2,0 0,-2z M10,26l2,0 0,2 -2,0 0,-2z M22,26l2,0 0,2 -2,0 0,-2z M24,26l2,0 0,2 -2,0 0,-2z M28,26l2,0 0,2 -2,0 0,-2z M36,26l2,0 0,2 -2,0 0,-2z M38,26l2,0 0,2 -2,0 0,-2z M46,26l2,0 0,2 -2,0 0,-2z M48,26l2,0 0,2 -2,0 0,-2z M50,26l2,0 0,2 -2,0 0,-2z M52,26l2,0 0,2 -2,0 0,-2z M54,26l2,0 0,2 -2,0 0,-2z M14,28l2,0 0,2 -2,0 0,-2z M20,28l2,0 0,2 -2,0 0,-2z M26,28l2,0 0,2 -2,0 0,-2z M32,28l2,0 0,2 -2,0 0,-2z M36,28l2,0 0,2 -2,0 0,-2z M38,28l2,0 0,2 -2,0 0,-2z M46,28l2,0 0,2 -2,0 0,-2z M50,28l2,0 0,2 -2,0 0,-2z M56,28l2,0 0,2 -2,0 0,-2z M12,30l2,0 0,2 -2,0 0,-2z M14,30l2,0 0,2 -2,0 0,-2z M16,30l2,0 0,2 -2,0 0,-2z M18,30l2,0 0,2 -2,0 0,-2z M22,30l2,0 0,2 -2,0 0,-2z M24,30l2,0 0,2 -2,0 0,-2z M36,30l2,0 0,2 -2,0 0,-2z M38,30l2,0 0,2 -2,0 0,-2z M46,30l2,0 0,2 -2,0 0,-2z M50,30l2,0 0,2 -2,0 0,-2z M52,30l2,0 0,2 -2,0 0,-2z M54,30l2,0 0,2 -2,0 0,-2z M56,30l2,0 0,2 -2,0 0,-2z M8,32l2,0 0,2 -2,0 0,-2z M10,32l2,0 0,2 -2,0 0,-2z M12,32l2,0 0,2 -2,0 0,-2z M18,32l2,0 0,2 -2,0 0,-2z M20,32l2,0 0,2 -2,0 0,-2z M22,32l2,0 0,2 -2,0 0,-2z M24,32l2,0 0,2 -2,0 0,-2z M26,32l2,0 0,2 -2,0 0,-2z M28,32l2,0 0,2 -2,0 0,-2z M34,32l2,0 0,2 -2,0 0,-2z M36,32l2,0 0,2 -2,0 0,-2z M40,32l2,0 0,2 -2,0 0,-2z M44,32l2,0 0,2 -2,0 0,-2z M46,32l2,0 0,2 -2,0 0,-2z M56,32l2,0 0,2 -2,0 0,-2z M8,34l2,0 0,2 -2,0 0,-2z M14,34l2,0 0,2 -2,0 0,-2z M18,34l2,0 0,2 -2,0 0,-2z M22,34l2,0 0,2 -2,0 0,-2z M24,34l2,0 0,2 -2,0 0,-2z M26,34l2,0 0,2 -2,0 0,-2z M28,34l2,0 0,2 -2,0 0,-2z M32,34l2,0 0,2 -2,0 0,-2z M38,34l2,0 0,2 -2,0 0,-2z M48,34l2,0 0,2 -2,0 0,-2z M54,34l2,0 0,2 -2,0 0,-2z M8,36l2,0 0,2 -2,0 0,-2z M10,36l2,0 0,2 -2,0 0,-2z M16,36l2,0 0,2 -2,0 0,-2z M18,36l2,0 0,2 -2,0 0,-2z M20,36l2,0 0,2 -2,0 0,-2z M22,36l2,0 0,2 -2,0 0,-2z M24,36l2,0 0,2 -2,0 0,-2z M26,36l2,0 0,2 -2,0 0,-2z M28,36l2,0 0,2 -2,0 0,-2z M36,36l2,0 0,2 -2,0 0,-2z M38,36l2,0 0,2 -2,0 0,-2z M42,36l2,0 0,2 -2,0 0,-2z M48,36l2,0 0,2 -2,0 0,-2z M50,36l2,0 0,2 -2,0 0,-2z M52,36l2,0 0,2 -2,0 0,-2z M54,36l2,0 0,2 -2,0 0,-2z M56,36l2,0 0,2 -2,0 0,-2z M8,38l2,0 0,2 -2,0 0,-2z M22,38l2,0 0,2 -2,0 0,-2z M28,38l2,0 0,2 -2,0 0,-2z M32,38l2,0 0,2 -2,0 0,-2z M34,38l2,0 0,2 -2,0 0,-2z M36,38l2,0 0,2 -2,0 0,-2z M42,38l2,0 0,2 -2,0 0,-2z M46,38l2,0 0,2 -2,0 0,-2z M50,38l2,0 0,2 -2,0 0,-2z M52,38l2,0 0,2 -2,0 0,-2z M56,38l2,0 0,2 -2,0 0,-2z M8,40l2,0 0,2 -2,0 0,-2z M14,40l2,0 0,2 -2,0 0,-2z M16,40l2,0 0,2 -2,0 0,-2z M18,40l2,0 0,2 -2,0 0,-2z M20,40l2,0 0,2 -2,0 0,-2z M24,40l2,0 0,2 -2,0 0,-2z M28,40l2,0 0,2 -2,0 0,-2z M30,40l2,0 0,2 -2,0 0,-2z M32,40l2,0 0,2 -2,0 0,-2z M38,40l2,0 0,2 -2,0 0,-2z M40,40l2,0 0,2 -2,0 0,-2z M42,40l2,0 0,2 -2,0 0,-2z M44,40l2,0 0,2 -2,0 0,-2z M46,40l2,0 0,2 -2,0 0,-2z M48,40l2,0 0,2 -2,0 0,-2z M52,40l2,0 0,2 -2,0 0,-2z M54,40l2,0 0,2 -2,0 0,-2z M24,42l2,0 0,2 -2,0 0,-2z M26,42l2,0 0,2 -2,0 0,-2z M28,42l2,0 0,2 -2,0 0,-2z M30,42l2,0 0,2 -2,0 0,-2z M40,42l2,0 0,2 -2,0 0,-2z M48,42l2,0 0,2 -2,0 0,-2z M52,42l2,0 0,2 -2,0 0,-2z M54,42l2,0 0,2 -2,0 0,-2z M8,44l2,0 0,2 -2,0 0,-2z M10,44l2,0 0,2 -2,0 0,-2z M12,44l2,0 0,2 -2,0 0,-2z M14,44l2,0 0,2 -2,0 0,-2z M16,44l2,0 0,2 -2,0 0,-2z M18,44l2,0 0,2 -2,0 0,-2z M20,44l2,0 0,2 -2,0 0,-2z M32,44l2,0 0,2 -2,0 0,-2z M34,44l2,0 0,2 -2,0 0,-2z M36,44l2,0 0,2 -2,0 0,-2z M40,44l2,0 0,2 -2,0 0,-2z M44,44l2,0 0,2 -2,0 0,-2z M48,44l2,0 0,2 -2,0 0,-2z M56,44l2,0 0,2 -2,0 0,-2z M8,46l2,0 0,2 -2,0 0,-2z M20,46l2,0 0,2 -2,0 0,-2z M30,46l2,0 0,2 -2,0 0,-2z M34,46l2,0 0,2 -2,0 0,-2z M38,46l2,0 0,2 -2,0 0,-2z M40,46l2,0 0,2 -2,0 0,-2z M48,46l2,0 0,2 -2,0 0,-2z M8,48l2,0 0,2 -2,0 0,-2z M12,48l2,0 0,2 -2,0 0,-2z M14,48l2,0 0,2 -2,0 0,-2z M16,48l2,0 0,2 -2,0 0,-2z M20,48l2,0 0,2 -2,0 0,-2z M24,48l2,0 0,2 -2,0 0,-2z M26,48l2,0 0,2 -2,0 0,-2z M28,48l2,0 0,2 -2,0 0,-2z M30,48l2,0 0,2 -2,0 0,-2z M34,48l2,0 0,2 -2,0 0,-2z M38,48l2,0 0,2 -2,0 0,-2z M40,48l2,0 0,2 -2,0 0,-2z M42,48l2,0 0,2 -2,0 0,-2z M44,48l2,0 0,2 -2,0 0,-2z M46,48l2,0 0,2 -2,0 0,-2z M48,48l2,0 0,2 -2,0 0,-2z M56,48l2,0 0,2 -2,0 0,-2z M8,50l2,0 0,2 -2,0 0,-2z M12,50l2,0 0,2 -2,0 0,-2z M14,50l2,0 0,2 -2,0 0,-2z M16,50l2,0 0,2 -2,0 0,-2z M20,50l2,0 0,2 -2,0 0,-2z M24,50l2,0 0,2 -2,0 0,-2z M32,50l2,0 0,2 -2,0 0,-2z M34,50l2,0 0,2 -2,0 0,-2z M40,50l2,0 0,2 -2,0 0,-2z M42,50l2,0 0,2 -2,0 0,-2z M44,50l2,0 0,2 -2,0 0,-2z M54,50l2,0 0,2 -2,0 0,-2z M56,50l2,0 0,2 -2,0 0,-2z M8,52l2,0 0,2 -2,0 0,-2z M12,52l2,0 0,2 -2,0 0,-2z M14,52l2,0 0,2 -2,0 0,-2z M16,52l2,0 0,2 -2,0 0,-2z M20,52l2,0 0,2 -2,0 0,-2z M28,52l2,0 0,2 -2,0 0,-2z M30,52l2,0 0,2 -2,0 0,-2z M34,52l2,0 0,2 -2,0 0,-2z M40,52l2,0 0,2 -2,0 0,-2z M42,52l2,0 0,2 -2,0 0,-2z M48,52l2,0 0,2 -2,0 0,-2z M50,52l2,0 0,2 -2,0 0,-2z M52,52l2,0 0,2 -2,0 0,-2z M54,52l2,0 0,2 -2,0 0,-2z M56,52l2,0 0,2 -2,0 0,-2z M8,54l2,0 0,2 -2,0 0,-2z M20,54l2,0 0,2 -2,0 0,-2z M24,54l2,0 0,2 -2,0 0,-2z M30,54l2,0 0,2 -2,0 0,-2z M32,54l2,0 0,2 -2,0 0,-2z M34,54l2,0 0,2 -2,0 0,-2z M44,54l2,0 0,2 -2,0 0,-2z M46,54l2,0 0,2 -2,0 0,-2z M48,54l2,0 0,2 -2,0 0,-2z M52,54l2,0 0,2 -2,0 0,-2z M54,54l2,0 0,2 -2,0 0,-2z M56,54l2,0 0,2 -2,0 0,-2z M8,56l2,0 0,2 -2,0 0,-2z M10,56l2,0 0,2 -2,0 0,-2z M12,56l2,0 0,2 -2,0 0,-2z M14,56l2,0 0,2 -2,0 0,-2z M16,56l2,0 0,2 -2,0 0,-2z M18,56l2,0 0,2 -2,0 0,-2z M20,56l2,0 0,2 -2,0 0,-2z M24,56l2,0 0,2 -2,0 0,-2z M26,56l2,0 0,2 -2,0 0,-2z M30,56l2,0 0,2 -2,0 0,-2z M32,56l2,0 0,2 -2,0 0,-2z M34,56l2,0 0,2 -2,0 0,-2z M40,56l2,0 0,2 -2,0 0,-2z M50,56l2,0 0,2 -2,0 0,-2z M56,56l2,0 0,2 -2,0 0,-2z \\" stroke=\\"transparent\\" fill=\\"black\\" /></svg>
@@ -732,6 +797,8 @@ exports[`fusuma-loader should convert all img src 1`] = `
732797

733798
import React from 'react';
734799
import { mdx } from '@mdx-js/react';
800+
import * as Client from '@fusuma/client';
801+
import * as Icons from 'react-icons/fa';
735802
export const slides = [props => <>
736803

737804
<h1>{\`img src\`}</h1>
@@ -775,6 +842,8 @@ exports[`fusuma-loader should convert class to className 1`] = `
775842

776843
import React from 'react';
777844
import { mdx } from '@mdx-js/react';
845+
import * as Client from '@fusuma/client';
846+
import * as Icons from 'react-icons/fa';
778847
export const slides = [props => <>
779848

780849
<h1>{\`Class\`}</h1>
@@ -818,6 +887,8 @@ exports[`fusuma-loader should convert emoji 1`] = `
818887

819888
import React from 'react';
820889
import { mdx } from '@mdx-js/react';
890+
import * as Client from '@fusuma/client';
891+
import * as Icons from 'react-icons/fa';
821892
export const slides = [props => <>
822893

823894
<h1>{\`😄\`}</h1>
@@ -857,6 +928,8 @@ exports[`fusuma-loader should convert markdown-syntax image to JSX 1`] = `
857928

858929
import React from 'react';
859930
import { mdx } from '@mdx-js/react';
931+
import * as Client from '@fusuma/client';
932+
import * as Icons from 'react-icons/fa';
860933
export const slides = [props => <>
861934

862935
<p><img src={require('/tmp/withAlt.jpg')} {...{
@@ -910,6 +983,8 @@ exports[`fusuma-loader should convert mermaid 1`] = `
910983

911984
import React from 'react';
912985
import { mdx } from '@mdx-js/react';
986+
import * as Client from '@fusuma/client';
987+
import * as Icons from 'react-icons/fa';
913988
export const slides = [props => <>
914989

915990
<h1>{\`FlowChart\`}</h1>
@@ -962,6 +1037,8 @@ exports[`fusuma-loader should convert mermaid using mermaid attr 1`] = `
9621037

9631038
import React from 'react';
9641039
import { mdx } from '@mdx-js/react';
1040+
import * as Client from '@fusuma/client';
1041+
import * as Icons from 'react-icons/fa';
9651042
export const slides = [props => <>
9661043

9671044
<h1>{\`FlowChart\`}</h1>
@@ -1014,6 +1091,8 @@ exports[`fusuma-loader should return normal md 1`] = `
10141091

10151092
import React from 'react';
10161093
import { mdx } from '@mdx-js/react';
1094+
import * as Client from '@fusuma/client';
1095+
import * as Icons from 'react-icons/fa';
10171096
export const slides = [props => <>
10181097

10191098
<h1>{\`1\`}</h1>
@@ -1053,6 +1132,8 @@ exports[`fusuma-loader should return normal mdx 1`] = `
10531132
import React from 'react';
10541133
import React from 'react';
10551134
import { mdx } from '@mdx-js/react';
1135+
import * as Client from '@fusuma/client';
1136+
import * as Icons from 'react-icons/fa';
10561137
export const slides = [props => <>
10571138

10581139

packages/mdx-loader/__tests__/index.js

+11
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,15 @@ console.log(a + b);
238238

239239
expect(await transformToJS(src)).toMatchSnapshot();
240240
});
241+
242+
test('should add sns accounts', async () => {
243+
const src = `
244+
<!-- account: twitter, name, hello -->
245+
<!-- account: github, name, bye -->
246+
<!-- account: facebook, name, hello -->
247+
<!-- account: linkedin, name, bye -->
248+
`;
249+
250+
expect(await transformToJS(src)).toMatchSnapshot();
251+
});
241252
});

0 commit comments

Comments
 (0)