playframework/playframework — pull request #2527 by pvlugter (2014-03-24 06:22:37+00:00)
Title: Add support for Java 8 code samples in documentation

Initial changes to support Java 8 samples in the documentation, with some examples in JavaAsync. More Java 8 samples will be added if this looks okay.

This adds tabbed code samples. To create a tabbed code sample a definition list is used, which is supported in markdown. For example:

```
## Async results

We have been returning `Result` up until now. To send an asynchronous result
our action needs to return a `Promise`:

Java
: @[async](code/javaguide/async/controllers/Application.java)

Java 8
: @[async](java8code/java8guide/async/controllers/Application.java)
```

This will render as something like:

![java](https://f.cloud.github.com/assets/59895/2496397/f78767f6-b31b-11e3-8141-63d3dee3e7cb.png)

Or the Java 8 tab:

![java8](https://f.cloud.github.com/assets/59895/2496398/fac531c8-b31b-11e3-81a9-7dadb66c0080.png)

Javascript is used to add the tabbed view. If javascript is disabled it renders as:

![no-javascript](https://f.cloud.github.com/assets/59895/2496402/0d01b69a-b31c-11e3-92be-7a8694b503e0.png)