38

I find myself visiting What is syntax highlighting and how does it work? on a regular basis to figure out what languages Prettify supports and by what names it calls them. I guess many others don't bother, or don't even know that language hints exist, leading to sub-optimal syntax highlighting in posts.

It would be great if there were some user interface to choose highlighting. What I have in mind is a small button next to the {} code formatting button. It might for example show a crayon, unless you come up with a better suggestion. Clicking on that button would open a dialog in much the same way the “add link” button does. That dialog could show a dropdown list of supported languages, and three buttons, titled “set for next block”, “set for all blocks” and “cancel”. I guess the “set for all blocks” button should insert its comment at the head of the post, as that would minimize surprises and users can still move that line around if they want to. The dropdown list might sort languages inferred from the tags to the top of the list.

6
  • 1
    @ShaWizDowArd, I see a relation, but no duplication. Both questions are asking for another button, but where I'm asking for a button to manually choose the language, that question asks for a button to automatically format (i.e. reindent, I believe) code based on the automatically inferred language.
    – MvG
    Oct 2, 2012 at 9:07
  • Not really a duplicate imo, this is not about formatting the actual code block, but about easily inserting language hints. (+1 from me btw!)
    – Jeroen
    Oct 2, 2012 at 9:08
  • 3
    The question is, is this used often enough to warrant added clutter to the user interface? Oct 14, 2012 at 1:42
  • @NullUserExceptionอ_อ: I can only speak for myself, but I know that I use language hints more often by far than headings or horizontal lines. I guess someone could use a data dump to obtain objective figures, but those would only show how often language hints are used, not how often the should be used even though they were not due to lack of a user interface.
    – MvG
    Oct 14, 2012 at 15:36
  • 1
    Maybe insert this inside the button [?]
    – brasofilo
    May 12, 2014 at 2:41
  • 1
    Let's see if this sees any response from anyone this time around...
    – J. Steen
    Jun 30, 2017 at 17:43

0

You must log in to answer this question.

Browse other questions tagged .