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

Copy button in the terminal #177

Open
GouravSardana opened this issue Mar 23, 2022 · 37 comments · May be fixed by #186
Open

Copy button in the terminal #177

GouravSardana opened this issue Mar 23, 2022 · 37 comments · May be fixed by #186
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@GouravSardana
Copy link
Member

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

@GouravSardana GouravSardana added enhancement New feature or request good first issue Good for newcomers labels Mar 23, 2022
@Rajarshi1001
Copy link

@GouravSardana Can I take up this issue?

@lainq
Copy link
Contributor

lainq commented Apr 4, 2022

Sure!

@Rajarshi1001
Copy link

Rajarshi1001 commented Apr 4, 2022

@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
Copy link
Member Author

@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
Copy link

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
Copy link
Member Author

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
Copy link

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
Copy link
Member Author

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
Copy link
Member Author

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

@Aspireve
Copy link

Aspireve commented May 9, 2022

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
Copy link
Member Author

@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
Copy link

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

@GouravSardana
Copy link
Member Author

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

@Aspireve
Copy link

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
Copy link
Member Author

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
Copy link

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

@GouravSardana
Copy link
Member Author

Damn 🤞Awesome, Looking forward to review

@Aspireve
Copy link

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

@GouravSardana
Copy link
Member Author

@Aspireve No issues. Looking forward :)

@Aspireve
Copy link

Aspireve commented Jul 29, 2022

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
Copy link

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

@Aspireve
Copy link

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

@GouravSardana
Copy link
Member Author

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

@Aspireve
Copy link

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

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

  • pressing any button like when you press 'p' it saves to playbook so maybe when you press 'c' it copies text
  • The second method is putting text on screen which if you press it copies text

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
Copy link

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

@Aspireve
Copy link

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 added a commit to Aspireve/dynamic-cli that referenced this issue Jul 30, 2022
Aspireve added a commit to Aspireve/dynamic-cli that referenced this issue Jul 30, 2022
Aspireve added a commit to Aspireve/dynamic-cli that referenced this issue Jul 30, 2022
Aspireve added a commit to Aspireve/dynamic-cli that referenced this issue Jul 30, 2022
Aspireve added a commit to Aspireve/dynamic-cli that referenced this issue Jul 30, 2022
Aspireve added a commit to Aspireve/dynamic-cli that referenced this issue Jul 30, 2022
@Aspireve Aspireve linked a pull request Jul 30, 2022 that will close this issue
5 tasks
Aspireve added a commit to Aspireve/dynamic-cli that referenced this issue Jul 30, 2022
@Aspireve
Copy link

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

@gkprasanth
Copy link

@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
Copy link
Member Author

@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
Copy link

@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
Copy link

Nit89 commented May 4, 2023

i want to contribute in this project

@NIveX2169
Copy link

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
Copy link

A15h commented May 20, 2023

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
Copy link

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

@IIAbinashMishraII
Copy link

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
Copy link

hey i would like to work on the issue

@Abhinavcode13
Copy link

Assign this issue to me @GouravSardana !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.