-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Markdown: Drop (or paste) image, file destination: relative path #193752
Comments
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
Adding:
Skipping |
Thanks @hediet! Looks like that documentation is coming from PS: and thank you @mjbvz for adding those new variables back in December, much appreciated!!! 🙇♀️ |
Issue marked as unreleased but unable to locate closing commit in issue timeline. You can manually reference a commit by commenting |
As per docs/languages/markdown#_inserting-images-and-links-to-files:
It would be useful to add two more variables containing the relative path.
Using the same example file as the docs (
/docs/api/readme.md
), and the same glob pattern ("/docs/**/*"
):/docs/api/
. This would be the same path that is returned by the "Copy Relative Path" command (copyRelativePathCommandHandler
), minus the filename. I'll tentatively call thisdocumentRelativeDirName
."/docs/**/*"
, the path relative to/docs/
would be/api/
. I'll tentatively call thisdocumentGlobRelativeDirName
.These would be useful if a project wishes to place all images within, say,
/src/assets/
.Using (1) above, an image dragged or pasted into
/docs/api/readme.md
would be copied into/src/assets/docs/api/readme/
(for the destination"/src/assets/${documentRelativeDirName}/"
), and using (2), into/src/assets/api/readme/
(for the destination"/src/assets/${documentGlobRelativeDirName}/"
).(the names
documentRelativeDirName
&documentGlobRelativeDirName
are not intended to be thoughtful suggestions, just throwing them out as examples to facilitate discussion)As this comment points out,
documentDirName
provides the absolute file system path, rather than the workspace-relative path as some might expect.References:
copyFiles.ts
: https://github.com/microsoft/vscode-uriThe text was updated successfully, but these errors were encountered: