Mermaid-Chart / vscode-mermaid-preview

Previews Mermaid diagrams
MIT License
148 stars 16 forks source link

[Feature] Support preview based on configured file type rather than file extension #116

Open moni-dips opened 11 months ago

moni-dips commented 11 months ago

I create a new text file in Code, select type as Mermaid and open the mermaid preview. Then I click inside the text file and paste some mermaid code. As troubleshooting steps, I tried moving code to each of my three monitors, but nothing changed.

Expected behaviour

Preview works


sequenceDiagram
    Alice->>+John: Hello John, how are you?
    Alice->>+John: John, can you hear me?
    John-->>-Alice: Hi Alice, I can hear you!
    John-->>-Alice: I feel great!```

### Actual behaviour
Preview does not work

Include:
   * Screenshot ![image](https://github.com/vstirbu/vscode-mermaid-preview/assets/126574585/59ac9322-166b-4aad-a5d6-94bd91ae9f68)
   * Preview mode: Mermaid
   * Theme used: dark
moni-dips commented 11 months ago

image

vstirbu commented 11 months ago

The extensions is active for stand alone files with extension .mmd. It does not look like that is the case in the attached screenshot.

moni-dips commented 11 months ago

I just created a new scratch file in code and selected the filetype as mermaid, there is no real file

vstirbu commented 11 months ago

The extension works only with stand alone markdown .mmd files or markdown files with embedded diagrams as describe in the documentation.

Activating the extension based on the file type is not supported. I'll have to investigate how that works before adding that functionality.