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

Configure file save location without a vFile? #8

Open
nonprofittechy opened this issue Jan 31, 2020 · 3 comments
Open

Configure file save location without a vFile? #8

nonprofittechy opened this issue Jan 31, 2020 · 3 comments

Comments

@nonprofittechy
Copy link

I am trying to use remark-mermaid with Docusaurus v2, which seems like it could be a very powerful combination.

However, by default remark-mermaid saves to the current directory. It would work if the remark plugin either ran the initialization script for mermaid.js when you use simple (not easy to insert that into markdown without swizzling, or at least I couldn't see that option in Docusaurus), or allowed you to more easily configure the save location for all images by passing it as an option at config time, just like the simple option.

@bgschiller
Copy link

bgschiller commented Jun 24, 2020

I have a fork (described in #10) that includes an imageDir plugin option, but it's relative to each file's location. Would that work for you, or would you expect such an option to be relative to the package root?

It doesn't matter either way to me, so I'm happy to change it. Much easier to change it before it's merged though.

@nonprofittechy
Copy link
Author

I think relative to the package root would work best here. At least for docusaurus, it expects all images to be in the /static/img directory, but you are allowed to put documents in subdirectories.

@ambroiseRabier
Copy link

ambroiseRabier commented May 9, 2022

Any update on this issue ? I would love to use mermaid with docusaurus.

I don't know how you figured out, that the problem is with the file save location, all I get is:

Compiled with problems:

ERROR in ./docs/temp/mermaid test.md

Module build failed (from ./node_modules/@docusaurus/mdx-loader/lib/index.js):
SyntaxError: L:\PROJECTS_3\WEB\teaching-support-website\docs\temp\mermaid test.md: Unexpected token (18:2)

  16 | export default function MDXContent({
  17 |   components,
> 18 |   ...props
     |   ^
  19 | }) {
  20 |   return <MDXLayout {...layoutProps} {...props} components={components} mdxType="MDXLayout">
  21 |     <svg {...{
    at instantiate (L:\PROJECTS_3\WEB\teaching-support-website\node_modules\@babel\parser\lib\index.js:72:32)

Edit: Seem like some stuff going on there: https://docusaurus.io/feature-requests/p/add-mermaid-support
Edit2: I guess the issue is somewhat resolved with https://github.com/sjwall/mdx-mermaid ?

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

No branches or pull requests

3 participants