vscode-carbon_now_sh icon indicating copy to clipboard operation
vscode-carbon_now_sh copied to clipboard

Add file explore menu item to capture entire file

Open ericadamski opened this issue 6 years ago • 12 comments

ericadamski avatar Jul 10 '18 10:07 ericadamski

Selected code is longer than 1000 characters, refusing to send to carbon.

code_2018-08-10_00-18-48

mittalyashu avatar Aug 09 '18 18:08 mittalyashu

This is due to URL limits. Currently 1000 is an arbitrary number, but it shouldn't be much longer than that.

ericadamski avatar Aug 10 '18 12:08 ericadamski

If it is the URL limit, then how will you implement this capture entire file feature.

mittalyashu avatar Aug 10 '18 12:08 mittalyashu

The file will have to be less than the limit :/

ericadamski avatar Aug 10 '18 12:08 ericadamski

@ericadamski Here I can provide a way to break through the URL length limit.

Use the puppeter to dynamically open the carbon page, then download the image.

This way you can generate images no matter how many bytes of length.

And puppeter can specify chrome executable file path, so you don't have to download chromium

axetroy avatar Jan 20 '19 14:01 axetroy

@axetroy, if you could implement that it would be amazing! ❤️

ericadamski avatar Jan 20 '19 15:01 ericadamski

@ericadamski

In this case, Chrome is a dependency of extension.

axetroy avatar Jan 23 '19 01:01 axetroy

track here https://github.com/dawnlabs/carbon/pull/644

waiting for carbon API

axetroy avatar Jan 23 '19 03:01 axetroy

How about using Github account token to create gist like code-settings-sync do, then open carbon.now.sh with gist id?

inori1707 avatar Mar 28 '19 08:03 inori1707

@inori1707 that is a great solution!!

I would love to see a PR that implements this.

A few questions:

  • Should we give the URL to the gist that was created to the user as well?
  • Should we delete the gist after we use it in carbon?
  • Should we only use a gist if the code is longer than the current limit?

ericadamski avatar Mar 28 '19 11:03 ericadamski

@ericadamski In my opinion,

  • We should notify the user the gist we created, and user can provide his gist id by config to avoid create new gist every time.
  • Maybe we could not delete the gist immediately because we don't know if carbon.now.sh has read it. We could save and use the same gist id to update the gist content next time.
  • It should be great if this is good for performance.

By the way, I am willing to make a PR, but maybe not very soon.

inori1707 avatar Mar 28 '19 13:03 inori1707

There is no rush for this implementation! So when you have the time it would be great to see a PR @inori1707 😄

ericadamski avatar Mar 28 '19 17:03 ericadamski