Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remarkPlugins: remark-mermaidjs - text cut off in class diagrams #169

Open
Abrom8 opened this issue May 21, 2024 · 0 comments
Open

remarkPlugins: remark-mermaidjs - text cut off in class diagrams #169

Abrom8 opened this issue May 21, 2024 · 0 comments

Comments

@Abrom8
Copy link

Abrom8 commented May 21, 2024

I'm currently facing an error with cut off text in mermaid class diagrams (see image below). It looks a bit like the Vocs css classes are colliding with the plugin. Other diagrams look fine.

I'm using the remark-mermaidjs plugin.

Screenshot 2024-05-21 at 12 57 34

vocs.config.ts:

import { defineConfig } from 'vocs'
import remarkMermaid from 'remark-mermaidjs'

export default defineConfig({
  title: 'Docs',
  sidebar: [
    {
      text: 'Getting Started',
      link: '/getting-started',
    },
    {
      text: 'Example',
      link: '/example',
    },
  ],
  markdown: { 
    remarkPlugins: [ 
      remarkMermaid 
    ] 
  }, 
})

example.mdx:

# Example

This is an example page.

```mermaid
classDiagram
    Animal <|-- Duck
    Animal <|-- Fish
    Animal <|-- Zebra
    Animal : +int age
    Animal : +String gender
    Animal: +isMammal()
    Animal: +mate()
    class Duck{
        +String beakColor
        +swim()
        +quack()
    }
    class Fish{
        -int sizeInFeet
        -canEat()
    }
    class Zebra{
        +bool is_wild
        +run()
    }
\`\`\`

package.json

{
  "name": "docs",
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vocs dev",
    "build": "vocs build",
    "preview": "vocs preview"
  },
  "dependencies": {
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "remark-mermaidjs": "^6.0.0",
    "vocs": "1.0.0-alpha.52"
  },
  "devDependencies": {
    "@types/react": "^18.3.2",
    "typescript": "^5.4.5"
  }
}

Thanks for providing this awesome Documentation Framework!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant