-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add syntax coloring #19
Comments
@tomasz-biernacki if you want you can work on this, toghther with a lil' improvement of the UI graphics...for instance I would love to make it a bit smaller (padding) |
Another idea is to use the simpler (and cljs only) puget because jqconsole supports ANSI: https://github.com/replit/jq-console#ansi-escape-code-sgr-support |
This one is not easy, and after talking and sharing ideas, @tomasz-biernacki made a very good point: we need to somehow hook info the prompt (I opened an issue on jqconsole and either write ANSI or inject our own Postponed for now. |
just to be on the same page we want to have color syntax while input to repl ? and while returning form it ? @arichiardi is right we can hack the |
Yes on .Write is easier with puget library, as jq-console supports ansi. |
With jQuery for instance, can you capture the element between jqconsole-prompt and jqconsole-cursor? Then we spray some highlightjs on top and we are done! |
yes we can! but need to be smart about it... will do some crazy demo 👯 don't be scared |
Now you are talking like Obama and I am scared |
😄 |
|
are you using highlightjs? that's cool, we will do the same with the write-output! it would be great to have syntax coloring for everything but we decrease brightness when the user evaluates. |
yep here i'm using the |
@piecyk It seems it doesn't work, it cannot find the namespace. If you try to do it in a regular Clojure application it works (I checked and it prints coloured output to the console) so it seems it's a ClojureScript problem. I asked Andrea to double check and he had the same problem. |
Yes it's not ported to clojurescirpt, the quickest why to check if lib can run in cljs is to check if it has cljs files... maybe i will try to port. It's decencies are small and it would be much better that |
By the way there exist cljsjs/highlightjs so everything can be ported to cljs :) |
Guys, I opened an issue, can you write that you have the same problem? 😄 |
As you can see in the issue guys, no luck with puget, but there is fipp |
fipp alone is not very useful for us, we need colors! man you read my mind i was driving car back home and was thinking about opening the issue... and 💥 there is an issue 👍 |
An other idea is to add what we need (a custom class) or key press events to |
this exactly what i'm doing now in the gif presented, i'm catching the event and coloring the block it's not pretty, it's dirty... i will have fresh look on that over the weekend... |
That's great, thanks for your help Damian. |
@piecyk I was thinking, maybe I can hack |
Closed by #56 |
I notice a lot of flashing, we will work on this ok? |
@piecyk I noticed two things:
|
I reopen this issue, in every project there is a painful point. So, two solutions, the cleaner is to change the highlighing so that we can have something cleaner using keypress events... |
A better explanation on how to wrap JS components -> https://github.com/Day8/re-frame/wiki/Using-Stateful-JS-Components |
@piecyk I also opened a repo called |
We can add syntax coloring easily (hopefully), using for instance highlight.js or better its
cljsjs
package.The text was updated successfully, but these errors were encountered: