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

Support pasting images in markdown files #529

Open
knugie opened this issue Mar 25, 2022 · 4 comments
Open

Support pasting images in markdown files #529

knugie opened this issue Mar 25, 2022 · 4 comments

Comments

@knugie
Copy link

knugie commented Mar 25, 2022

I like Lepton a lot for many reasons. A feature I use a lot when creating/editing markdown gists in a browser is pasting images directly. I would love to see this feature being aded to Lepton.

Kapture 2022-03-25 at 09 56 56

Would that be something other people are interested in too?

@knugie
Copy link
Author

knugie commented Mar 25, 2022

On a more technical note

✅ As far as I can tell, Electron supports pasting image content https://www.electronjs.org/docs/latest/api/clipboard#clipboardreadimagetype

🤔 However, it looks like there is a major technical obstacle: GitHub doesn't support uploading image content programatically - isaacs/github#1133
People have been looking into workarounds for that, but hosting Lepton users' images in e.g. a hackjutsu repo would break a couple of Lepton's core concepts https://gist.github.com/maxisam/5c6ec10cc4146adce05d62f553c5062f

@knugie
Copy link
Author

knugie commented Mar 25, 2022

💡 Adding images as files in the user's gist might work (https://docs.github.com/en/rest/reference/gists#create-a-gist). Those images could then be referenced with their raw_url in md file, e.g. https://gist.github.com/knugie/55b6e043dee0a1781810db2131ed89fb

I know the result is not the same, but I would be totally happy with that, plus it even adds to offline usage convenience and portability capabilities. 🤷

@hackjutsu
Copy link
Owner

Thanks for the research. Image hosting is a blocker and I'm hesitant to introduce a Lepton-specific solution. But if someone implements what @knugie suggests above, I'm happy to add it behind a .leptronrc config.

@uwezi
Copy link

uwezi commented Mar 22, 2023

I would absolutely support @knugie 's suggestion. Currently I am opening the gist in a browser window directly after creating it with lepton, and then I add the image there - however, the big disadvantage I see there is that the image itself is not included when you later download the gist from Github again. Having the image file as part of the gist would make sure that they stay together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants