3
$\begingroup$
                           

In this question (edit: and this question and increasingly many others) I have added a short python script as a code block (all lines indented by four spaces). In stackoverflow, adding the Tag python turns on the highlighting appropriate for python.

Is there a way to do that here - it looks so drab now!

update: per comments below, it looks like language sensitive highlighting for code blocks may not be activated here. If not, is there any interest in turning it on?

four spaces turns on code blocks

so those are available, it's just that

language-sensitive highlighing is not available, so it's just drab gray.

See here as a random example just for comparison.

$\endgroup$
  • 1
    $\begingroup$ Answered here: meta.stackexchange.com/questions/184108/… $\endgroup$ – Brian Tompsett - 汤莱恩 May 6 '16 at 11:36
  • $\begingroup$ @BrianTompsett-汤莱恩 I'm trying to turn on syntax highlighting in space.stackexchange - python was entered manually as a tag in the linked question (it's wasn't available at the time) but I don't see the highlighting yet. Is there something more in that link that I am missing? $\endgroup$ – uhoh May 11 '16 at 14:36
  • 1
    $\begingroup$ Yes, I edited the question to turn it on and it was not effective. I wonder if this feature is disabled in SX... $\endgroup$ – Brian Tompsett - 汤莱恩 May 11 '16 at 15:07
  • $\begingroup$ @BrianTompsett-汤莱恩 I wonder if i is easy to 'disable the disable' - and if there is a way to trigger the language sensitivity without inserting a python tag into the question. $\endgroup$ – uhoh Aug 15 '16 at 12:16
  • $\begingroup$ The Stack Exchange developers have been quite overburdened for some time now, and they are not very inclined to spend time on small changes to small Beta sites. One can't really blame them. Success is such a burden :). Considering the number of other feature-requests in the queue right now, it sort of behooves us to leave aside small changes for the time being. $\endgroup$ – kim holder Aug 18 '16 at 17:22
  • $\begingroup$ @kimholder Kim if you click on the example in the last line of my question you can see this is an existing feature, going way back to the beginnings of stackoverflow. It's turned on in some SE sites but not in others. Check the sentence labeled update above. $\endgroup$ – uhoh Aug 18 '16 at 22:06
2
$\begingroup$

edit: I'm wondering, will the occasional python script here in SXSE actually break the bandwidth bank on the server side here? And compared to the page load delays associated with inserting MathJax equations which is done all over the place here, will it really have a significant impact? I don't think there is a significant down-side to turning it on here.

However, if code or script is used in an answer, but the name of the language is not tagged (e.g. python) in the question, I don't know if there is another way to activate the language sensitivity.


There is a question&answer cluster on the "main meta" about language-sensitive syntax highlighting. Essentially there are bandwidth costs on the server side, and load time costs for the rest of us, so it's not active by default on many/most sites.

I don't think there's a big need for it here in SX SE myself - we're only talking about color highlighting.

As long as I can do this here by indenting with four spaces - I'm happy!
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .