A Slidev transformer that integrates BudouX for improved text wrapping in Japanese, Simplified Chinese, Traditional Chinese, and Thai languages.
Caution
Maybe you don't need this transformer. Just add the following snippet to index.html
<head>
<script src="https://unpkg.com/budoux/bundle/budoux-ja.min.js"></script>
</head>
More info at BudouX
- Supports automatic line breaking for:
- Japanese (ja)
- Simplified Chinese (cs)
- Traditional Chinese (ct)
- Thai (th)
- Easy integration with Slidev
- Customizable default language
npx jsr add @ryoppippi/slidev-transformer-budoux
Add the transformer to your Slidev setup file:
// setup/transformers.ts
import { budouxCodeblock } from '@ryoppippi/slidev-transformer-budoux';
import { defineTransformersSetup } from '@slidev/types';
export default defineTransformersSetup(() => {
return {
pre: [],
preCodeblock: [budouxCodeblock('ja')], // Set the default language (optional)
postCodeblock: [],
post: [],
};
});
In your Slidev markdown files, use the <budoux>
tag or language-specific tags:
<budoux>こんにちは、世界!</budoux>
<budoux-ja>こんにちは、世界!</budoux-ja>
<budoux-cs>你好世界!</budoux-cs>
<budoux-ct>你好世界!</budoux-ct>
<budoux-th>สวัสดีโลก!</budoux-th>
See actual processing results from slides.md in GH pages.
Creates a transformer function for Slidev.
defaultLanguage
: Optional. Sets the default language for<budoux>
tags. Defaults to 'ja'.
- Japanese (ja)
- Simplified Chinese (cs)
- Traditional Chinese (ct)
- Thai (th)
Contributions are welcome! Please feel free to submit a Pull Request.
This project uses BudouX for text segmentation.