Syntax Highlighting in the forum


#1

I often come across code examples in the forum, which are hard to read because of missing syntax highlighting. Fortunately Discourse (our forum software) offers Github style code blocks with syntax highlighting. You can find more about it in the Github docs: https://help.github.com/articles/github-flavored-markdown/#syntax-highlighting

It’s super easy to use and it would be fantastic if you could add it wherever possible.

Cheers, Bastian


PHP color formatting in Kirby forum
Trouble With Uniform Plugin
#3

I noticed that the highlighting js library doesn’t seem to be able to handle yaml code blocks - so sample code for blueprints always end up mis-highlighted. Is there a ‘safe’ syntax for yaml, or at least a way to turn the syntax highlighting off for our blueprint code?


#4

##Hint:

In my blueprint code I use the word ini as the code word after the three tickmarks


#5

A blueprint is technically YAML, so yml will give you really nice results. :wink:


#6

This is what yml looks like:

title: Page
pages: true
files: true
fields:
  title:
    label: Title
    type:  text
  text:
    label: Text
    type:  textarea

This is what ini looks like:

title: Page
pages: true
files: true
fields:
  title:
    label: Title
    type:  text
  text:
    label: Text
    type:  textarea

#7

@luxlogica:
Thank you for your nice confirming the contents of my above post.


#10