IndianOpenSourceFoundation / dynamic-cli

A Modern, user-friendly command-line HTTP client for the API testing, and if you're stuck - Search and browse StackOverflow without leaving the CLI
https://pypi.org/project/dynamic-cli/
GNU General Public License v3.0
169 stars 120 forks source link

Copy button in the terminal #177

Open GouravSardana opened 2 years ago

GouravSardana commented 2 years ago

If you fetch the questions from StackOverflow in Dynamic. It'll pop up in the terminal. We need a button there to copy the terminal text only to the clipboard

Rajarshi1001 commented 2 years ago

@GouravSardana Can I take up this issue?

lainq commented 2 years ago

Sure!

Rajarshi1001 commented 2 years ago

@pranavbaburaj Should I copy only the Question to the clipboard or the entire Question Link? I also wanted to say that if I have to use an additional python library to implement this feature, how should I modify the pyproject.toml file since it contains all the preset dependencies?

GouravSardana commented 2 years ago

@Rajarshi1001 you don’t need to copy the question. You have to copy the code snippet which is available in the answers

please avoid using dependencies, try to create it

Rajarshi1001 commented 2 years ago

SInce in the above issue it was mentioned that I need to copy the terminal text to the clipboard, I thought it to be the questions that pop up for a specific topic and I have already implemented that feature to copy the question link? There might be several code-snippets for a specific question or there may not be any code-snippets at all so how can I copy the most relevant one?

GouravSardana commented 2 years ago

You don’t need to copy everything. We should have a button or something similar to copy the code from snippets. User can choose the snippet to copy

for copying the question- Why user wants to copy the question? To see the question in the browser, just hit enter and it’ll redirect

Rajarshi1001 commented 2 years ago

I guess it is difficult to create a button which is rendered in the terminal using python. I have searched for various resources for reference but nothing seems to work.

GouravSardana commented 2 years ago

Not exactly a button but something from where we can copy the snippet If you see in the terminal, we can able to differentiate between text and snippets. So using the same thing you have to copy it to clipboard

GouravSardana commented 2 years ago

Anybody working on this? Should i make this as open?

Aspireve commented 2 years ago

hey @GouravSardana, I would like to work on this issue and could you please assign me? Also, I would like to get some info on how can I add this in the code part? Are there any references that I can look into? I would love the help! Thanks

GouravSardana commented 2 years ago

@Aspireve Thanks for showing interest in contributing to dynamic cli.

I’ll tell where you can add this code and how:

first install dynamic cli in your local and try to run “dynamic -s” enter anything like python and skip tags because those are options. You’ll see some results and you can toggle between these by up arrow and down arrow from your keyboard. Just look for any answers contains the code. You’ll see we differentiate the code in the black color. You have to see the code, how we’re differentiate the code and the text that where you have to add your changes. Either add a text button or something which user can easily recognise to copy.

let me know if you need any more information.

looping @pranavbaburaj

Aspireve commented 2 years ago

Hi!! This is actually my first time ever doing something like this so it might take me a bit longer to understand it.

GouravSardana commented 2 years ago

No issues. If you need any help just put all your questions here

Aspireve commented 2 years ago

Hi @GouravSardana!! I actually tried a few things to from creating a button to something to copy stuff from the terminal but nothing really seems to work.

GouravSardana commented 2 years ago

Did you tried copying it to clipboard? You don’t actually need a button just see how we are differentiating between normal text and code.

Aspireve commented 2 years ago

Hi @GouravSardana I was able to find a way to solve it. Soon Ill create a pull request

GouravSardana commented 2 years ago

Damn 🤞Awesome, Looking forward to review

Aspireve commented 1 year ago

Aye I completely forgot to do it, got caught up in a lot of stuff. Will do it soon!!

GouravSardana commented 1 year ago

@Aspireve No issues. Looking forward :)

Aspireve commented 1 year ago

Hey @GouravSardana, I tried doing it again as I don't have the older file but when I run it it gives me this error ImportError: cannot import name 'MarkdownRenderer' from 'markdown' (/usr/lib/python3/dist-packages/markdown/__init__.py) It had worked out the last time when I tried it

Aspireve commented 1 year ago

I tried pip3 install markdown and it shows Requirement already satisfied: markdown in /usr/lib/python3/dist-packages (3.1.1)

Aspireve commented 1 year ago

So I was able to overcome it by commenting out the import MarkdownRenderer for now, hope its fine

GouravSardana commented 1 year ago

May be version issue. Can you install markdown from the requirements? So that it’ll install the correct version

Aspireve commented 1 year ago

Hey @GouravSardana I finally got it to run, Thanks!!

Also I had two ways of copying code, one could be by

The pressing button seems a bit more better as it stays consistent with the ret of the program but the press-text-to-copy method seems more intuitive Which method should I use?

Aspireve commented 1 year ago

Hey @GouravSardana Could You explain how do you differentiate between the code and the answer?

Aspireve commented 1 year ago

Yay @GouravSardana I found a way to do it with the keyboard button 'c', Ill refine the code a bit and PR it How's this?

Untitled-1 - dynamic-cli - Visual Studio Code 2022-07-30 15-46-14

Aspireve commented 1 year ago

Hey @GouravSardana I made a pull request. Do review it and tell me if anything else needs to be added

gkprasanth commented 1 year ago

@GouravSardana Hey, I know a little bit about Python, but I've never given back to an open source project. Are you sure I can help with this problem? This concept definitely caught my attention.

GouravSardana commented 1 year ago

@gkprasanth Hey, Yes this is a beginner friendly project. If you think you can contribute, please go ahead and read the readme instructions and let me know if that’s unclear or need more work.

gkprasanth commented 1 year ago

@GouravSardana I would love to contribute to this project. I want to know how much knowledge of Python do I need to know to contribute?

Nit89 commented 1 year ago

i want to contribute in this project

NIveX2169 commented 1 year ago

Hey I'm New to Open source contribution as a GSSOC 2023 I want to contribute to this issue Please assign it to me

A15h commented 1 year ago

hi @GouravSardana I would really like to work on this issue and add a copy button in the terminal. Please assign this issue to me. I am a contributor of GSSOC'23.

harshsingh32 commented 1 year ago

I would like to work on this issue, please assign this issue to me under GSSoC'23.

IIAbinashMishraII commented 1 year ago

Hi, @GouravSardana, Is it possible for you to assign it to me? I have already figured out how to create a copy to clipboard button. Thank you.

Pranav-Rayaprolu commented 1 year ago

hey i would like to work on the issue

Abhinavcode13 commented 1 year ago

Assign this issue to me @GouravSardana !!