Codeblocks in Discourse

When making code blocks in Discourse posts, you can specify the language that it is in. This way the code block will be color coded correctly for the language. It’s really useful for making the code you’re sharing easily readable to the rest of the community.

Link to the guide: https://discourse.stonehearth.net/t/discourse-guide-code-formatting/30587

List of options:
“lang-auto”, “1c”, “actionscript”, “apache”, “applescript”, “avrasm”, “axapta”, “bash”, “brainfuck”,
“clojure”, “cmake”, “coffeescript”, “cpp”, “cs”, “css”, “d”, “delphi”, “diff”, “xml”, “django”, “dos”,
“erlang-repl”, “erlang”, “glsl”, “go”, “handlebars”, “haskell”, “http”, “ini”, “java”, “javascript”,
“json”, “lisp”, “lua”, “markdown”, “matlab”, “mel”, “nginx”, “objectivec”, “parser3”, “perl”, “php”,
“profile”, “python”, “r”, “rib”, “rsl”, “ruby”, “rust”, “scala”, “smalltalk”, “sql”, “tex”, “text”,
“vala”, “vbscript”, “vhdl”

Edit: Moved from #general to #Howto-Feedback

1 Like