Comments (2)
If you embed a file that is more than a couple of levels removed from the current one, the link will be embedded as a fixed path. Arguably this should be a file://xxx/
path, but frankly that's not going to work any better unless the file exists in that path, so really that's a non-issue with a fully qualified physical path.
As to relative path embedding:
If you want relative paths you can add configuration into your root folder or the YAML header of the document that specifies a root path. More info here:
When this is set MM searches up the hierarchy for files and uses that path as the /
root folder for creating relative paths.
Otherwise, anything further back than 2 parent paths up from the current path is considered an absolute path.
Ultimately if you're working on a project that has 'root' you should add one of these marker files into the root folder of the project - that's the most reliable way to get clean project relative paths.
from markdownmonster.
If you embed a file that is more than a couple of levels removed from the current one, the link will be embedded as a fixed path. Arguably this should be a
file://xxx/
path, but frankly that's not going to work any better unless the file exists in that path, so really that's a non-issue with a fully qualified physical path.
The main issue is that command Insert link
(Ctrl+K) of MM does not convert an absolute Windows file path to a relative URL whenever possible and probably most users strongly dislike doing this tedious conversion manually.
In the original post I forgot to point out that the behavior of Insert link
depends on how the local file path is entered into the Link:
field. There are two cases:
- The local file path is entered directly by typing or pasting.
- The local file path is entered indirectly by the
...
button.
The example in the original post refers to case 1. In this case MM never converts an absolute local path to a relative one. After all it converts the spaces to %20
when you press the Paste Link
button.
In case 2 the behavior of MM is better. It converts an absolute local path to a relative one if the directory of the current file contains the linked file.
So reconciling these two cases should actually be the first improvement.
When this is set MM searches up the hierarchy for files and uses that path as the
/
root folder for creating relative paths.Otherwise, anything further back than 2 parent paths up from the current path is considered an absolute path.
Why do you restrict the conversion?
I suggest to make a file path relative whenever possible, that is as already mentioned above, relative to the current file if the linked file and the current file formally reside on the same volume. By "formally" I mean, that the linked file is not required to be existent when you create the link.
Maybe Insert link
(Ctrl+K) should have an option like use absolute path
to suppress the conversion in rare special cases.
Ultimately if you're working on a project that has 'root' you should add one of these marker files into the root folder of the project - that's the most reliable way to get clean project relative paths.
This route is MM-specific. Therefore it is impractical for my environment and presumably for most others.
from markdownmonster.
Related Issues (20)
- Distraction free HOT 7
- Problem when Markdown Monster is launched via InfoQube HOT 5
- How does one register the software on a VM which is offline and can't be connected to the internet? HOT 2
- Disable image preview option HOT 2
- Feature request: Change tabs with the keyboard HOT 3
- Portable MM is adding itself to the PATH HOT 2
- Image preview not working when # in path HOT 1
- Previous Portable versions HOT 3
- Drop the image to insert the link error HOT 4
- solved
- OpenAI Integration HOT 2
- Feature request: language setting per document HOT 2
- Incorrect syntax highlighting
- Settings does not keep the selected Preview Theme if Theme has Spaces in the Folder Name HOT 6
- Registration email address case sensitive HOT 10
- Add-in's Missing HOT 2
- icon error
- Is there a keyboard shortcut and/or a KeyBinding Id that I could use to perform a "Format Table"? HOT 8
- Add Support for MathJax 3.0 HOT 1
- Couldn't find a compatible Webview2 Runtime installation to host WebViews HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdownmonster.