Skip to content
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

Drag and Drop to create Markdown videos in MDX files #378

Open
4 tasks done
karlhorky opened this issue Dec 21, 2023 · 0 comments
Open
4 tasks done

Drag and Drop to create Markdown videos in MDX files #378

karlhorky opened this issue Dec 21, 2023 · 0 comments
Labels
🤞 phase/open Post is being triaged manually

Comments

@karlhorky
Copy link

Initial checklist

Problem

Quickly authoring MDX documents by dragging and dropping videos is a nice DX

There is a drag and drop feature introduced in VS Code 1.70 (thanks @mjbvz) that allowed for handling dropped files (either from the VS Code explorer, editor tabs, the OS, or other applications) (extension sample) - activate this feature by holding shift while dragging a file.

With Markdown files (*.md), VS Code allows for creating a Markdown video:

Inserting.a.video.using.drag.and.drop.mp4

It would be amazing if creating Markdown videos with drag and drop was also supported in an MDX file.

Currently, it inserts the path.

Solution

Apparently in VS Code 1.78 (April 2023) - or maybe earlier - there is an option for extensions to contribute their own options to this list:

VS Code includes a few built-in ways to drop common content formats. Extensions can also add their own drop options using the DocumentDropEditProvider API.

Source: https://code.visualstudio.com/updates/v1_78#_drop-selector

Maybe this would be the way to contribute this action of "Insert Markdown Video"

I would suggest a simple implementation:

  • only handle single video files
  • HTML video element without extra source elements

Related

Drag and drop for images has been implemented in PR #346 and #357, as a response to #322

Alternatives

Installing the Drag And Drop Import Relative Path extension by @ElecTreeFrying

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤞 phase/open Post is being triaged manually
Development

No branches or pull requests

1 participant