|
There is a new dependency in PyDS - the SilverCity source highlighting component. This allows you to have codeblocks with highlighted sourcecode for all languages that are supported by SilverCity. The directive is code-block and you need to give one parameter, the language.
Supported language modules with SilverCity 0.9.5 are: Perl, Ruby, Python, CPP (for C and C++), CSS, SQL, XML, XSLT, HyperText (html with embedded ASP languages like VBScript!) and YAML. Many similar languages can be rendered with one of those renderers (like C or C++ headers).
An example in C (if you use the code-block directive, you probably need to bracket it in raw .. end raw cheetah directives because of the include statements in C or C++ or the comments in Python or Perl):
#include <stdio.h>
void main(int argc, char **argv) {
printf("Hello World\n");
}
Thanks go to Roberto Alsina for his pointer to an ASPN article that showed how to do it.
If you want to use this feature, it is currently only in CVS. You need to make changes to your stylesheet, too (there are several classes for the syntax highlighting). The styles that need to be added are in CVS as silvercity.css (they are merged into the default pyds.css, too). Of course you need to install the SilverCity module, too.
For Debian users there are new packages at the http://simon.bofh.ms/~gb/debian-dev/ repository.
|