-
Notifications
You must be signed in to change notification settings - Fork 227
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
Link in markdown when outputting to subdir #369
Comments
The vast majority of Markdown renderers/parsers assume that image links are relative to the current markdown file's directory. So, the image link won't contain the subdir, because the markdown is also in the subdir, so they're both in the same directory. This is because it's the same way For example, if your markdown file is If you instead use There are some rare Markdown renderers/parsers that don't follow that standard. Old alpha versions of docusaurus v2 didn't work that way, hence why I made a remark plugin that stores the image files within the markdown file (see https://github.com/aloisklink/remark-mermaid-dataurl). I'm going to mark this as "Won't fix". But let us know though if there's a Markdown program which works otherwise! It might be worth re-opening this if there's demand for this feature (we could hide it behind an option like |
Thanks for the in-depth response and info! Currently I am using pandoc and it seems to work based on directory it is run in For example, if you have a project layout layout like this...
If you run pandoc from I managed to work around this using Thanks again! |
Ah, Pandoc is a bit different. Most Markdown parsers are designed to make HTML/websites with multiple pages. However, Pandoc is designed to combine multiple Markdown files into a singe PDF document. It's great if you're know LaTeX, but it is a bit confusing from a HTML background. For Pandoc (>=2.14), I'd recommend using the official |
Is the default behavior when outputing to a subdir and markdown for the image link not to be in the subdir?
E.g.
Running
./node_modules/.bin/mmdc -i src/main.md -o dist/main_updated.md
leads to markdown with output like thisWould it not be better for it to the link into the subdir? e.g.
I apologize for the initial PR actually hit enter and for bad wording
The text was updated successfully, but these errors were encountered: