Code samples should be in separate files, compiled and tested, as per:

https://github.com/playframework/Play20/blob/master/documentation/manual/hacking/Documentation.md