0.2.12 โข Published 8 months ago
slidev-parser v0.2.12
Features โจ
๐ Enhanced Markdown
- Full MDC support
- Seamless Vue component integration
- Style modifiers (e.g.
{.text-blue}) - Nested syntax and shortcuts
๐จ UnoCSS Integration
- Atomic CSS utilities
- Dynamic class generation
- Icon preset support
- Custom rules & theming
๐งฉ Component System
- Remote component loading
- Custom component injection
- Real-time component updates
- Full lifecycle management
๐ Layout Templates
default- Standard layoutcenter- Centered contentcover- Cover slidetwo-cols- Two-column layoutimage-right/left- Image with textiframe- Embedded frame
๐ฅ Advanced Features
- Browser-side rendering
- Responsive design
- Zoom controls
- Theme customization
- Hot component reload
Installation ๐ฆ
# Using npm
npm install slidev-parser
# Using yarn
yarn add slidev-parser
# Using pnpm
pnpm add slidev-parserUsage Guide ๐
Basic Usage
<script setup>
import { SlideRender } from 'slidev-parser'
import 'slidev-parser/index.css'
const slide = {
frontmatter: {
layout: 'cover', // Use cover layout
},
content: `
# My Presentation {.text-blue-500}
Content written in **Markdown**
`,
note: 'Speaker notes here'
}
</script>
<template>
<SlideRender
id="my-slide"
:slide="slide"
:zoom="1"
:slide-aspect="16 / 9"
/>
</template>Multiple Slides
<script setup>
import { SlidesRender } from 'slidev-parser'
import 'slidev-parser/index.css'
const slides = [
{
frontmatter: { layout: 'cover' },
content: '# First Page',
},
{
frontmatter: { layout: 'two-cols' },
content: `
# Left Content
::right::
# Right Content
`,
}
]
</script>
<template>
<SlidesRender :slides="slides" />
</template>Remote Components
<script setup>
import { SlideRender } from 'slidev-parser'
import 'slidev-parser/index.css'
const slide = {
frontmatter: {
layout: 'cover',
},
content: `
# My Presentation
<remote url="https://gist.githubusercontent.com/MarleneJiang/b205007f50abcbc404f07127439c686a/raw/05414d8f57cf7d0af626200f73feb19d01d79619/test.vue"/>
`,
note: 'Speaker notes here'
}
</script>
<template>
<SlideRender
id="my-slide"
:slide="slide"
/>
</template>Custom Components
<script setup>
import { SlideRender } from 'slidev-parser'
import CustomComp from './CustomComp.vue'
import 'slidev-parser/index.css'
const slide = {
frontmatter: {
layout: 'cover',
},
content: `
# My Presentation
<CustomComp/>
`,
note: 'Speaker notes here'
}
</script>
<template>
<SlideRender
id="my-slide"
:slide="slide"
/>
</template>Configuration Options
interface BaseConfigOptions {
mdOptions?: Record<string, any>
sfcOptions?: Record<string, any>
components?: Record<string, Component>
}
export interface RendererOptions extends BaseConfigOptions {
unoConfig?: {
customConfigRaw?: string
customCSSLayerName?: string
uno?: boolean
}
SlideLoading?: Component
SlideError?: Component
}Warn
- CAN NOT be used in SSR environment, if you want to use it in
Nuxt, you can setssr: falseinnuxt.config.jsto disable SSR.
0.2.12
8 months ago
0.2.11
9 months ago
0.2.10
9 months ago
0.2.9
10 months ago
0.2.9-beta.1
10 months ago
0.2.8
10 months ago
0.2.7
10 months ago
0.2.6
10 months ago
0.2.5
10 months ago
0.2.4
10 months ago
0.2.3
10 months ago
0.2.2
10 months ago
0.2.1
11 months ago
0.2.0
11 months ago
0.1.2
11 months ago
0.0.1-beta.2
11 months ago
0.0.1-beta.1
11 months ago