ContextSearch-web-ext icon indicating copy to clipboard operation
ContextSearch-web-ext copied to clipboard

Add copy as markdown option

Open sbstn87 opened this issue 7 years ago • 11 comments

Hi, could you ad an option to copy selected text with a markdown formatting? There's an extension that does something similar, so you perhaps could reuse some parts of its code: https://github.com/chitsaou/copy-as-markdown

Best regards, Sebastian

sbstn87 avatar Oct 12 '18 12:10 sbstn87

I have found an extension that does precisely that, but it would be nice to have this feature integrated into ContextSearch: https://github.com/0x6b/copy-selection-as-markdown

Regards

sbstn87 avatar Oct 12 '18 17:10 sbstn87

Sure I'll get something set up. I'm working on a big update so I won't get to it right away.

ssborbis avatar Oct 12 '18 18:10 ssborbis

I have some time to look into this now. What specific things are you wanting to copy as markdown? Links & images?

ssborbis avatar Nov 01 '18 19:11 ssborbis

OK, so basically I would like to have an option in the context menu to copy selection as markdown - exactly the same functionality as offered by the extension I mentioned: https://github.com/0x6b/copy-selection-as-markdown

There are examples shown of what it does.

I have also recorded what is the effect when I copy a selected text using your extension, Firefox's copy function and using the 'Copy as a Markdown' extension: https://sendvid.com/qheo3ldg

By the way as you can see, copying text through your extension copies only the text without the formatting - I think it should copy the text with the formatting, just as the Firefox's copy function does.

sbstn87 avatar Nov 02 '18 08:11 sbstn87

By the way as you can see, copying text through your extension copies only the text without the formatting - I think it should copy the text with the formatting, just as the Firefox's copy function does.

I used the hacky way copy text to avoid adding another permission.

I'll need to think a bit on how to integrate with quick and context menus, but I'll have something for the next big release.

ssborbis avatar Nov 03 '18 07:11 ssborbis

I'll need to think a bit on how to integrate with quick and context menus, but I'll have something for the next big release.

What you mean is that you will integrate 'Copy as markdown' option or FF's copy function?

sbstn87 avatar Nov 03 '18 15:11 sbstn87

What you mean is that you will integrate 'Copy as markdown' option or FF's copy function?

Markup. I'll toy around with some ideas and post again here when I have something in the repo worth testing.

ssborbis avatar Nov 04 '18 07:11 ssborbis

Checking out the add-on now... seems pretty solid.

If it's working for you, why not continue using it? What benefit would there be to having the functionality integrated into ContextSearch over what you have now?

ssborbis avatar Nov 06 '18 03:11 ssborbis

Yeah, the add-on works very well for me.

The reasons are two-fold:

  • having one less extension installed
  • higher productivity and convenience, that is why I use your extension to copy or search stuff in DDG/Amazon/Youtube

sbstn87 avatar Nov 06 '18 06:11 sbstn87

I'm still looking into this, but it just seems like a function best suited for a separate addon, what with all the additional options for formatting. I did however come across some some simple bookmarklets that will copy links and page urls to markdown, which should integrate with ContextSearch and be available to all menus. If you need something more robust, you're probably better off with a dedicated add-on.

For example:

https://gist.github.com/bradleybossard/3667ad5259045f839adc

https://github.com/benbalter/copy-issue-link-bookmarklet

ssborbis avatar Dec 01 '18 08:12 ssborbis

Great, thanks for the update and your work!

sbstn87 avatar Dec 01 '18 08:12 sbstn87