Discourse can syntax highlight several different coding languages (it uses highlightjs
to do so) which can be specified if you use the backtick blocks, however it isn’t syntax highlight MATLAB syntax yet, so I was wondering if you could try to enable it in the discourse settings panel (there is an option for this apparently)?
% this is a test of MATLAB syntax highlighting, only generic things like strings
% and numbers are highlighted, this comment is not, suggesting wrong language used
if a > b
c = unint32(12);
else
c = 'Char array';
end
# Ruby code for comparison, note comments are coloured etc.
class Greeter
def initialize(name)
@name = name.capitalize
end
def salute
puts "Hello #{@name}!"
end
end
# Create a new object
g = Greeter.new("world")
# Output "Hello World!"
g.salute