How do I use Syntax Prettifier?

nelkaakenelkaake Member
edited June 2012 in Questions
We have Syntax Prettifier enabled on our install, but how do users know it's there or know how to use it?

Comments

  • TimTim Staff
    Syntax Prettifier works on content inside [ code ] tags.
    So wherever someone would normally use a plain code tag, Prettifier will take over and highlight the contents.
  • @Tim Sweet, thanks for that. Is there a tag to indicate what number to start at?
  • If you mean changing the line numbers next to the code, I don't believe there's a way of changing that. You'd need to note it separately for your users as text before or after the code.
  • donnachadonnacha Member, Commenter
    edited October 2012
    It doesn't seem to work on my forum.

    I mostly just want line-numbering to work.

    It would be extremely useful if there could be a link, somewhere obvious, pointing to documentation that explains any arguments we should be adding to the code tags.
  • LincolnLincoln Staff
    edited October 2012
    Howdy @donnacha, Syntax Prettifier should be all you need.

    To show properly formatted code, do this:

    <pre><code> Your code </pre></code>

    The Button Bar addon provides a 'C' (Code) button for quickly wrapping code in those tags.
  • billybilly Member
    edited December 2012
    Hey, it load a different css, but i dosent show line numbers..
This discussion has been closed.