klaus icon indicating copy to clipboard operation
klaus copied to clipboard

Highlight lines of code

Open district10 opened this issue 5 years ago • 8 comments

Currently, klaus supports hightlight one line, e.g. http://klausdemo.lophus.org/~jonashaag/klaus/blob/master/setup.py#L-18

Could it be possible to support range selection like on Github: https://github.com/jonashaag/klaus/blob/master/setup.py#L18-L27 (hold shift to select lines)

Thank you.

district10 avatar Jan 05 '21 07:01 district10

Yes, if anyone wants to work it that would be great!

jonashaag avatar Jan 05 '21 11:01 jonashaag

Hi, I would like to work on this feature. Based on the request, I am trying to decide between two approaches: (a) A new query string parameter (selections). This allows us to keep the previous single selection instead of overloading the single selection (b) Overloading the single selection, with something like http://klausdemo.lophus.org/~jonashaag/klaus/blob/master/setup.py#L-18&L-27.

Are this approaches sufficient or is there an approach that would be preferable, in line with the structure of the project.

castellanprime avatar Jan 13 '21 19:01 castellanprime

Nice! Can we make it like GitHub?

jonashaag avatar Jan 13 '21 21:01 jonashaag

Oh. Okay. I will look into making it like Github. Thanks.

castellanprime avatar Jan 14 '21 16:01 castellanprime

I am sorry if this question sounds foolish. I wanted to ask how the testing in this project is normally done. I am trying to manually test, that is, view some kind of log of the variables but I am so far unable to do so. First, (a) I tried using pdb but pdb never reaches the breakpoint I set in views.py. (b) I tried to using python logging, but the logs are not showing up, Coming from Tornado, i would normally disable the tornado.access module to get the logs that I want, but I do not know module to disable for Flask. My only recourse now is to write a "unit test" to test my changes. Is my situation unique and if so, how do I go about resolving it? Thanks.

castellanprime avatar Jan 15 '21 04:01 castellanprime

How do you start Klaus exactly? If you use the CLI the logs should show up in the terminal. Flask also has a very nice debugger. You can also start Klaus using another WSGI server if you want.

jonashaag avatar Jan 15 '21 07:01 jonashaag

I normally start it with the cli, like klaus [dir1] ... What i wanted to was to print not the request logs, the actual application logs. That is, if I put a print statement in the views.py, I want to see it in the consoie logs as well.

castellanprime avatar Jan 16 '21 00:01 castellanprime

That should be exactly what’s happening by default. Are you sure your changes are even effective? Maybe the CLI loads the Klaus modules from some other path outside of the Git checkout? (eg installed with pip)

jonashaag avatar Jan 16 '21 08:01 jonashaag