It is common on wiki sites that deal with snippets of code to highlight the syntax of pasted code by coloring the important parts of code according to their function. To do that, however, the wiki engine needs to know the language of the code snippet.
This is a proposal of a common way of specifying the (computer) language in which a snippet of code is written. If accepted, this specyfication would go the the CreoleAdditions, as not all wiki engines have or need this function. However, some of the propositions require a change in core Creole to allow ignoring of not supported markup.
{{{#!c
#include <stdio.h>
int main(intr argc, char *argv[]) {
printf("Hello world!\n");
return 0;
}
}}}
If the name of the language is not recognized by the wiki engine (or the wiki engine doesn't support this addition), the markup is treated as part of the opening block markup and does not affect rendering in any way.
Putting the markup on the same line as the opening "{{{" is a clear indication that it is not part of the code, and that it will not be displayed. It will also avoid confusion if the code snippet contains its own shebang.
Using the language name without any path or parameters makes it easy and fast to type, clear to read and portable between different wiki engines.
Welcome Visitor
Log in