Python syntax highlighting

I suspect that some recent update to the forum has thrown-off the Python syntax highlighting. It seems to more often ‘default’ to Java (or some other language?). You can get it to highlight Python by coaxing it – writing a comment here or there, or adjusting your code formatting slightly.

Perhaps there’s some way to set the default highlighting to Python for the Processing.py section?

1 Like

Okay –

So it turns out you can use a language identifier, al a Github Flavored Markdown, to control the highlighting. That’s a language name that immediately follows your opening pair of triple-quotes (that define a code block). For example:

``` java

void hello(){}

``` pyhton

def hello():
void hello(){}

``` javascript

function hello(){}
def hello():
void hello(){}
1 Like