What does "relative paths will be resolved relative to the optional origin file" mean?

With this folder structure:

And this same code in b:

dv.span(await dv.io.load("a.md"))

It seems to me that the content of a is rendered only when a is in the root or when both are in the same folder. Other combinations of the locations make it not rendered.

Say a is in subfolder and b is in folder. This is the code that works:

dv.span(await dv.io.load("a.md", "folder/subfolder/a.md"))

./subfolder/a.md or subfolder/a.md doesn’t work.

I read the docs:

dv.io.load(path, [origin-file])
Load the contents of the given path (a link or string) asynchronously. Relative paths will be resolved relative to the optional origin file (defaulting to the current file if not provided). Returns the string contents of the file, or undefined if the file does not exist.

But still doesn’t get how this works. Can you help?

i cannot help (i am not the author of said plugin) other than to say when in doubt, use full paths

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.