I am using Markdown Monster to create user docs on a Windows machine. they are deployed on a Ubuntu machine running Docsify. The image links break when deployed. The folder structure on both machines is
docs/Topic1/Images
docs/Topic2/Images
there are files
docs/Topic1/topic1.md
docs/Topic1/Images/topic1img.jpg
docs/Topic2/topic2.md
docs/Topic2/Images/topic2img.jpg
in Markdown Monster, the code src="Images/topic1img.jpg" or src="./Images/topic1img.jpg" works.
in Docsify, I need to use the code src="Topic1/Images/topic1img.jpg" This does not preview correctly in Markdown Moster.
I have tried setting relative path in Docsify but no joy. Is there a way to use the same code and see the same preview in Markdown Monster on Windows that I would see on Docsify/Ubuntu?
Not sure I fully understand, but I think what you want is a base path for your 'project' that provides the same root as your live site does. What this does is resolve / or ~/ in the previewer to the path you specify or 'mark' with a marker file.
There are two ways to do this:
- Using a Yaml document header or Project value
- Use a marker file in the root folder
Generally the marker file is the easier way to do this and I typically do this. So I copy a .markdownmonster file into the root folder and that resolves the / path to the path when previewing. You can now reference things based on the root of the site in the same way that the live site does bringing the two into sync.
You can find more info on how to configure a root base path here:
A related thing: I've created a documentation tool that is designed specifically for creating cross linked Markdown based documentation. It uses most of MM's editor features along with the project management features and dedicated cross-linking support and many other documentation specific features.
It generates ready to run static Web sites that can be hosted anywhere.
Still in beta, but I've been using it for all of my doc sites for about 3 months now.
+++ Rick ---
Thanks for your reply.
"but I think what you want is a base path for your 'project' that provides the same root as your live site does"
yes, that is correct. The path on both my Windows machine and the live site (running Docsify) is docs/Topic1/Images/
the .md files are in docs/Topic1/ and the images are in docs/Topic1/Images/
Docsify requires the path to images to be specified as: Topic1/Images/topic1img.jpg
when I use this path in MM, my image breaks in the preview. I should note that I am using the following code to display the image so I can get wrap text around it.
<img src="Topic1/Images/topic1img.jpg" align="right" width="80" hspace="20">
I have tried putting a .markdownmonster file in the docs folder and in the docs/Topic1 folder. Neither makes any difference - the image does not resolve in the preview.
I also tried using backslashes in the links - does not make a difference either.
btw, the URL to the help page on the MM website does not resolve correctly in the email. It comes out with a leading underscore. _https://markdownmonster.west-wind.com/docs/Recipes/Configuring-Site-Relative-Base-Paths.html
Well, you can't use docs/blah/somefile.png and expect some path fixup, as that's considered a relative path from the current document. That's not a Markdown Monster thing BTW, but the way the Web works 😄. How would you tell the difference between a relative path and a 'docs' path? If that's a requirement of your doc tool then that's downright silly.
The correct way to deal with this - and how just about any Web based templating tool deals with this - is to have some sort of base path that can be identified at render time. On the final Web site that'll be the root folder of the Web site. In MM for previewing it'll be the location of the marker file. Typically that's / or in your case it may be /docs/ (in which case the base path would be the parent of the docs folder and where you'd put the .markdownmonster marker file).
I'm pretty sure that you're perhaps missing something in your docsify workflow as root path resolution should work in any Web based tool. At minimum you should always be able to resolve links based on relative paths from the current document. (../images/someimage.png or ./images/someimage.png). Again if the tool doesn't support that - that would be silly.
+++ Rick ---