Jump to content

Suggestion: Syntax highlighting in 3.1 :)


EDAInsight

Recommended Posts

Posted

For some technical forums, syntax highlighting is a key feature. Recently, I find GeSHi is a great product, and have used it in my wikis. I hope it will be integrated in IP.Board 3.1, or act as an extension.

BTW, My english is very poor. I hope you have understand what's my meaning.

Posted

It just does...

int foo (int k) { if (k < 0 || k > 2) { printf ("out of range\n"); printf ("this function requires a value of 1 or 2\n"); } else { printf ("Switching\n"); switch (k) { case 1: printf ("1\n"); break; case 2: printf ("2\n"); break; } } }


























This is the program we use: http://code.google.com/p/google-code-prettify/

Posted

Technically, prettyprint does have a way to explicitly set the language, but you don't generally need to do that. If you use

[sql]This is an SQL query[/sql]



it does

This is an SQL query </pre>

<pre class='prettyprint lang-sql'>



You could adapt another bbcode to do something similar if you needed (i.e. have an option parameter to specify the language, then pass that as a class to prettyprint).

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...