slidev-theme-viplay
v0.1.3
Published
Some components for slidev
Readme
slidev-theme-viplay
Some components for Slidev.
Installation
npm i slidev-theme-viplay --saveor
yarn add slidev-theme-viplayor
pnpm i slidev-theme-viplayComponents
This theme provides the following components:
- SlidesSubtitle - provide subtitle and tts for slides, you can custom languages and tts models.
Usage
SlidesSubtitle
Create a ./global-top.vue file in your Slidev project and use the component:
<script setup lang="ts">
import { Subtitles } from 'slidev-theme-viplay/types'
const contents = {
zh_CN: {
page1: {
click0: [
'大家好,欢迎来到Slidev',
'今天讲一下Slidev的特点和用法',
'让我们开始吧/D/1000',
],
},
},
en: {
page1: {
click0: [
'Hello everyone, welcome to Slidev!',
'Now i will talk about the features and usage of Slidev.',
'Let\'s get started./D/1000',
],
},
},
}
const config = {
noTTSDelay: 5000,
ttsApi: 'http://localhost:3000/api/v1/tts',
ttsLangName: {
en: 'English(US)',
},
}
const subtitles = new Subtitles(contents, config)
</script>
<template>
<slides-subtitle :subtitles="subtitles" />
</template>Contributing
npm installnpm run devto start theme preview ofexample.md- Edit the
global-bottom.vueto see the changes npm run exportto generate the preview PDFnpm run screenshotto generate the preview PNG
