mstroppel / remark-local-plantuml

Render PlantUML diagrams locally and embed it into the markdown file.
MIT License
4 stars 1 forks source link

Support for Docusaurus v3 #5

Open skyfrk opened 9 months ago

skyfrk commented 9 months ago

The plugin is currently not compatible with Docusaurus v3.

Steps to reproduce

  1. Create a new docusaurus app npx create-docusaurus@latest my-website classic
  2. Install this plugin.
  3. Try to render a simple plantuml in Markdown:
```plantuml Your title
class SimplePlantUMLPlugin {
    + transform(syntaxTree: AST): AST
}


4. Get an error

## Notes

Its probably an issue caused by the migration to MDX v3: https://docusaurus.io/docs/migration/v3#upgrading-mdx
mstroppel commented 9 months ago

Shown error is:

Error: MDX compilation failed for file "C:\data\github\remark-local-plantuml-docusaurus\docs\simple.md"
Cause: Cannot handle unknown node `raw`
Details:
Error: Cannot handle unknown node `raw`
mstroppel commented 9 months ago

@ksandin already created a workaround for something similar: https://github.com/shikijs/twoslash/issues/125#issuecomment-1710838839

mstroppel commented 9 months ago

I added a workaround for docusaurus v3 in #9 See the main page.

mstroppel commented 9 months ago

@ksandin already created a workaround for something similar: shikijs/twoslash#125 (comment)

This fix is used here https://github.com/mstroppel/remark-local-plantuml-docusaurus/tree/fix/hacky-docusaurus-v3-fix But I would not recommend it, since it is pretty hacky.

mstroppel commented 9 months ago

Workaround was seen here https://github.com/excaliburjs/Excalibur/pull/2793/files#diff-6165458b00f7d0251872e75af62bd54496e809f8793639ccd4d5b7461b017806 Thanks to @kamranayub