Closed rubik closed 11 years ago
I believe what you are looking for is something that should be up-to the user to implement.
For example.. https://github.com/akshayaurora/CodeEd
This is a extremely rough
code editor that uses pygments to highlight code. This uses markup to get it's
desired output.
Hope this helps
I had precisely that in mind, only I did not know how to implement it. Thank you for your quick reply! I gave the code a cursory glance and it seems a bit hacky to implement. I'll read again the code in my own good time to understand how it work!
Thank you
I wonder if the innards of kivy.core.text.markup.MarkupLabel
could be extracted into something like kivy.core.text.markup.MarkupEngine
? That would allow it's logic to be reused for other widgets (or even custom widgets).
Better question might be if this is feasible or not. Again, I'm super tired, but I might look into this over my weekend (tues & wed)
+1 on that for me. I could be reused more easily.
@rubik Does the new CodeInput Widget fulfill what was being asked for? If so let us know so, the issue can be closed
I haven't had the time to check that out and actually try it, but I guess it does. So this issue can be closed, leaving room for improvements on CodeInput Widget.
How do I make CodeInput work like a MarkupLabel? Is there any ready-to-use lexer for it? I just tried MarkdownLexer but it did not work as I thought it would
I just read this: https://pygments.org/docs/lexerdevelopment/ and it seems to me that this solution is very limited to certain tokens, we can't change the colors and we can't change the tokens in real time, so it is far from being a good alternative to a TextInput with MarkupLabel
@rubik please reopen
It s far better that Markup Label ...
You can implement your own token syntax You can implement your own style And all of this in realtime.
Addition of markup tags ([color], [bold], &c.) to TextInput, like Label's ones.