slidev icon indicating copy to clipboard operation
slidev copied to clipboard

Shiki Magic Move ignores transformers from ./setup/shiki.ts

Open Sdju opened this issue 1 year ago • 2 comments

  1. create setup/shiki.ts
  2. add some transformers eg
/* ./setup/shiki.ts */
import { defineShikiSetup } from '@slidev/types'
import { transformerNotationDiff, transformerNotationWordHighlight } from '@shikijs/transformers'

export default defineShikiSetup(() => {
  return {
    themes: {
      'dark': 'min-light',
      'light': 'min-light',
    },
    transformers: [
      transformerNotationWordHighlight(),
    ]
  }
})

2.1 add some basic styles for class highlighted-word 3. add new slide with some content with shiki magic move and some content without it

```html
// [!code word:article]
<article>
  <h1>
    Hello
  </h1>
</article>
```

````md magic-move
```html
// [!code word:article]
<article>
  <h1>
    Hello
  </h1>
</article>
```
````
  1. check the result image

As i can see there is difference betwheen the magic move version and the version without it. In the documentation no clues about that. In the shiki config gide too.

  • OS: windows 10
  • Browser: Chrome 122.0.6261.112
  • Slidev version: 0.48.7

I really want to use word highlighting + magic move. If it is not possible then the documentation should warn about it.

Thank You!

Sdju avatar Mar 23 '24 06:03 Sdju

Unfortunately, Magic Move does not support transformers at this moment

antfu avatar Mar 23 '24 09:03 antfu

Thank You for answering!

It's OK. Then, i think. the documentation should contain this information

Something like this: #1464

Sdju avatar Mar 23 '24 09:03 Sdju