// lib/docs.js
import { AppProps } from 'next/app';
import { ThemeProvider } from 'styled-components';
import { AnimateSharedLayout } from 'framer-motion';
import '../styles/dracula-prism.css';
import GlobalStyles from '../styles/GlobalStyles';
import darkTheme from '../styles/themes/dark';
const MyApp: React.FC<AppProps> = ({ Component, pageProps }) => (
<ThemeProvider theme={darkTheme}>
<GlobalStyles />
<AnimateSharedLayout>
<Component {...pageProps} />
</AnimateSharedLayout>
</ThemeProvider>
);
export default MyApp;
Divide
// lib/markdown.js
import remark from 'remark';
import html from 'remark-html';
import prism from 'remark-prism';
export default async function markdownToHtml(markdown) {
const result = await remark().use(html).use(prism).process(markdown);
return result.toString();
}