sx.el icon indicating copy to clipboard operation
sx.el copied to clipboard

syntax highlighting for code

Open ChillarAnand opened this issue 9 years ago • 10 comments

sx

it will be good if there is syntax highlighting for code.

ChillarAnand avatar Jul 02 '15 11:07 ChillarAnand

There usually is, it's just a little hard to identify whether a block is code or text, and what language sould be used to highlight in that case. For instance, we don't yet check for language tags, we just use some reasonable heuristics.

Could you provide a link to that post so that we can figure out what to do?

Malabarba avatar Jul 02 '15 11:07 Malabarba

@Malabarba http://stackoverflow.com/questions/31167228/python-list-to-dict-conversion-confusion

thanks for amazing sx.el!!

ChillarAnand avatar Jul 02 '15 12:07 ChillarAnand

Ok thanks. This is indeed one of those cases that would be solved if we took question tags into consideration. @vermiculus and I have been very busy lately, but I promise we'll get to it at some point!

Malabarba avatar Jul 02 '15 12:07 Malabarba

Will it be slow if we toggle syntax highlight on big source code block? Like Org-mode, it will slow down.

stardiviner avatar Oct 18 '15 10:10 stardiviner

@stardiviner No, it shouldn't be slow because we only perform syntax highlighting once (when the question buffer is first created), whereas typical major-modes usually have to do it on every redisplay.

Malabarba avatar Oct 18 '15 10:10 Malabarba

I see. That's great.

stardiviner avatar Oct 18 '15 11:10 stardiviner

Any progress on this? It seems like it should be fairly easy to implement and it would really help when reading posts that have a lot of code.

ylluminarious avatar Nov 10 '16 20:11 ylluminarious

No progress as of yet that I'm aware of (both of us are very busy and really can only find the time for things we need at this moment), but pull requests are welcome!

vermiculus avatar Nov 10 '16 21:11 vermiculus

@vermiculus Alright. Do you think you could give any advice on where to start for implementing this?

ylluminarious avatar Nov 10 '16 21:11 ylluminarious

You're going to want to start around sx-question-mode--insert-markdown.

vermiculus avatar Nov 11 '16 13:11 vermiculus